model传给View数据,这是很正常的啊。可以去看看MVC的图。
1000万条记录的网站,就我现在理解而言,还没有很好的办法去解决。如果用sql语句来选取得话,我估计也快不到那去!
model传给View数据,这是很正常的啊。可以去看看MVC的图。
1000万条记录的网站,就我现在理解而言,还没有很好的办法去解决。如果用sql语句来选取得话,我估计也快不到那去!
为什么不用controller来控制view 呢,包括数据。
这句话我再同意不过了!这是非常明显的事。但是考虑到可移植性,我不会选择存储过程!考虑到通用型,我同样不会选择存储过程!再考虑到数据库支持(MySql便宜好用),我更不会选择存储过程!
当然你非要用,我也不反对。
Control的确控制view,但是Control绝对不控制数据!数据的取得是直接从model取得的!
但是我现在使用中又出现了中文问题,真是该死的中文。
请看看http://www.jdon.com:81/jive/thread.jsp?forum=16&thread=1111。
看看定义
View
A View renders the contents of a model. It accesses data from the model and
specifies how that data should be presented. When the model changes, it is the
view’s responsibility to maintain consistency in its presentation. The view forwards
user gestures to the controller.
个人感觉数据是由Model直接传的。
sql语句实现分页可以参考:
http://www.javaresearch.org/article/showarticle.jsp?column=108&thread=2028
在jsp页面中
Iterator it=Model.getDatas();