📄 701502.xml
字号:
<?xml version='1.0' encoding='GB2312'?>
<?xml-stylesheet type='text/xsl' href='../csdn.xsl'?>
<Topic>
<Issue>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<TopicId>701502</TopicId>
<TopicName>大家讨论一下JSP技术开发的模式?</TopicName>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<RoomName>JSP</RoomName>
<ReplyNum>21</ReplyNum>
<PostDateTime>2002-5-6 17:06:08</PostDateTime>
<Point>100</Point>
<ReadNum>0</ReadNum>
<RoomId>28</RoomId>
<EndState>2</EndState>
<Content>以页面为中心的方法
1.jsp(page-view)
2.jsp+javaBean(page-view with bean)
一般我们采用的是以上两种。
我现在已从第一种过度到第二种。
我到是感觉jsp+javaBean就够了。
但我最近看到还有jsp+javaBean+servlet模式
实在想不通为什么还要用servlet.
书上说是“调度员”模式
什么Mdiator-View
Mediator-Composite View(MCV)
Service-to-Workers
越看越糊涂。
有那位高手指点指点。
</Content>
</Issue>
<Replys>
<Reply>
<PostUserNickName>失去你是我今生最大的痛</PostUserNickName>
<rank>一星(中级)</rank>
<ranknum>star1</ranknum>
<credit>151</credit>
<ReplyID>4594456</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>203548</PostUserId>
<PostUserName>realyfly</PostUserName>
<Point>5</Point>
<Content>MVC实际上就是模型-视图-控制
模型:表示数据或应用对象,用于操作和向用户显示内容
视图:模型的屏幕显示,表示模型的当前对象
控制器:定义了用户界面于用户输入进行交互的方法,是操作模型的对象
在jsp+javaBean+servlet中jsp是作为MVC的视图,Servlet作为MVC的控制器
EJB/Beans作为MVC的模型
jsp就是负责把结果显示出来,Servlet负责对模型进行必要操作,并把处理结果转发给jsp显示,EJB/Bean负责复杂的商业逻辑处理
</Content>
<PostDateTime>2002-5-6 17:23:39</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4594600</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<Point>0</Point>
<Content>是不是可以这样考虑?
JSP+JavaBean+服务器处理生成*.class==JSP+JavaBean+Servlet
也就是说
他们本质是一样的,而表现形式不同。
第一种服务器所要承受的工作要比第二种大,要经过一次转化。
</Content>
<PostDateTime>2002-5-6 17:33:46</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>失去你是我今生最大的痛</PostUserNickName>
<rank>一星(中级)</rank>
<ranknum>star1</ranknum>
<credit>151</credit>
<ReplyID>4594696</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>203548</PostUserId>
<PostUserName>realyfly</PostUserName>
<Point>5</Point>
<Content>模型-视图-控制是设计模式,服务器最终运行的时候,都要把servlet,jsp,javabean等转化成.class文件的,mvc是设计思想,而不是服务器的思想</Content>
<PostDateTime>2002-5-6 17:41:45</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4594961</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<Point>0</Point>
<Content>也就是说把jsp中用于操作的分离出来,用servlet实现。
服务器端是Servlet+JavaBean
而输出到客户端是JSP
</Content>
<PostDateTime>2002-5-6 18:06:29</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>失去你是我今生最大的痛</PostUserNickName>
<rank>一星(中级)</rank>
<ranknum>star1</ranknum>
<credit>151</credit>
<ReplyID>4595014</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>203548</PostUserId>
<PostUserName>realyfly</PostUserName>
<Point>0</Point>
<Content>呵呵,差不多!</Content>
<PostDateTime>2002-5-6 18:11:04</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4595088</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<Point>0</Point>
<Content>我还有疑问:
是不是可以不要做jsp文件?都用Servlet实现。
在JSP与JavaBean模式中,在/work/目录下会生成xxxxx.java,再编译为xxxxx.class
那还不如把jsp全部都转为Servlet.</Content>
<PostDateTime>2002-5-6 18:18:49</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>态度决定一切,java支配世界</PostUserNickName>
<rank>三级(初级)</rank>
<ranknum>user3</ranknum>
<credit>100</credit>
<ReplyID>4595090</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>28250</PostUserId>
<PostUserName>Yang_Sun</PostUserName>
<Point>40</Point>
<Content>呵呵,我觉得上面的讨论好像有点概念问题。第一位说得很有道理,jsp技术是可以分类的,一种是纯jsp页面,一种是jsp+javabean,还有一种就是servlet+jsp+javabean(也就是常说的Module 2)。
那么,为什么非要在网页中使用servlet呢,不是有jsp就足够了吗?呵呵,那就错了,jsp+javabean确实在小型环境中足够了,再加上java tablib的帮助,应该没什么问题。但是,到了,大型项目的话,可就不行了。不知道你们有否感觉,做一个稍微大型一点的网站,如果全部使用jsp的话,最痛苦的可能就算是页面之间的导航了,根据条件不同,而导航到不同的网页,小了jsp还可以承受,工程打了,一个页面的导航增多,那可就把整个jsp搞乱了,基本都是导航的判断代码。
而servlet的引入,可以解决这个问题,servlet当作一个接入点,用户的请求都发给servlet,servlet根据用户的配置,将请求发给相应的页面。呵呵,这只是一个servlet使用的好处。
大家可以看看jakata的struts项目,那个就是一个开源的mvc结构,看一下大家就会明白了。
kookw说得不对,jsp也只是编译一次,这个不影响负荷的,呵呵。</Content>
<PostDateTime>2002-5-6 18:19:04</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4595097</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<Point>0</Point>
<Content>jsp与Servlet还是应该有交互呢?</Content>
<PostDateTime>2002-5-6 18:20:07</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>态度决定一切,java支配世界</PostUserNickName>
<rank>三级(初级)</rank>
<ranknum>user3</ranknum>
<credit>100</credit>
<ReplyID>4595131</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>28250</PostUserId>
<PostUserName>Yang_Sun</PostUserName>
<Point>20</Point>
<Content>当然有,在MVC结构中,servlet作为controller,它将请求(request)转发给相应的jsp,那jsp使用doGet之类方法,不就是交互吗?你看看struts吧,你就明白了。</Content>
<PostDateTime>2002-5-6 18:23:03</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>失去你是我今生最大的痛</PostUserNickName>
<rank>一星(中级)</rank>
<ranknum>star1</ranknum>
<credit>151</credit>
<ReplyID>4595239</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>203548</PostUserId>
<PostUserName>realyfly</PostUserName>
<Point>5</Point>
<Content>其实有一种这样的说法:jsp的出现是完全可以替代Servlet,因为Servlet的编写要求有很好的java基础,而jsp却步要求那么高,但是实际上jsp在编译的时候是先编译成相对应servlet的。而在整个J2EE体系结构中,难点应该是EJB。</Content>
<PostDateTime>2002-5-6 18:36:03</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>二流带刀</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4596126</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>151608</PostUserId>
<PostUserName>mechiland</PostUserName>
<Point>0</Point>
<Content>呵呵,有所收获!同意 yang_sun(态度决定一切,java支配世界)的观点。</Content>
<PostDateTime>2002-5-6 19:46:22</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4597961</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<Point>0</Point>
<Content>jsp应该还是有影响。
当你执行jsp文件时,第一次会有延迟。这是因为JSP页面首先翻译为一个Java类,
再编译成一个Servlet.以后就没有了.
而Servlet,是已编译好了的。</Content>
<PostDateTime>2002-5-6 22:09:35</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>穆斯林信徒</PostUserNickName>
<rank>三级(初级)</rank>
<ranknum>user3</ranknum>
<credit>92</credit>
<ReplyID>4600139</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>179289</PostUserId>
<PostUserName>pingju</PostUserName>
<Point>0</Point>
<Content>什么是struts,中文翻译过来是什么意思?哪个网站有介绍struts的东东?</Content>
<PostDateTime>2002-5-7 8:25:58</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4603046</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<Point>0</Point>
<Content>http://jakarta.apache.org/struts/index.html
英文</Content>
<PostDateTime>2002-5-7 12:15:32</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>失去你是我今生最大的痛</PostUserNickName>
<rank>一星(中级)</rank>
<ranknum>star1</ranknum>
<credit>151</credit>
<ReplyID>4603104</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>203548</PostUserId>
<PostUserName>realyfly</PostUserName>
<Point>5</Point>
<Content>http://www-900.ibm.com/developerWorks/java/j-struts/index.shtml
中文的,应该有所收获</Content>
<PostDateTime>2002-5-7 12:19:31</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>SurfeR</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4603215</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>220096</PostUserId>
<PostUserName>KooKvv</PostUserName>
<Point>0</Point>
<Content>struts的英文解释
Why is it called Struts? 
It's a reference to struts in the architectural sense, a reminder of the nearly invisible pieces that hold up buildings, houses, and bridges.
 
</Content>
<PostDateTime>2002-5-7 12:28:57</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>jacky</PostUserNickName>
<rank>五级(中级)</rank>
<ranknum>user5</ranknum>
<credit>105</credit>
<ReplyID>4603729</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>30398</PostUserId>
<PostUserName>kkhui</PostUserName>
<Point>0</Point>
<Content>那是jsp model 2 (servlet作为controller)</Content>
<PostDateTime>2002-5-7 13:04:46</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>态度决定一切,java支配世界</PostUserNickName>
<rank>三级(初级)</rank>
<ranknum>user3</ranknum>
<credit>100</credit>
<ReplyID>4614477</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>28250</PostUserId>
<PostUserName>Yang_Sun</PostUserName>
<Point>0</Point>
<Content>struts就是结构,架构的意思呀,实际Jakatar Struts的功能也就是创建一个架构,你可以使用这个架构,添加自己的应用逻辑。
还有,现在www.theserverside.com上有一本关于struts的样书,对理解model2很有好处</Content>
<PostDateTime>2002-5-8 10:03:19</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>我吃多了</PostUserNickName>
<rank>二级(初级)</rank>
<ranknum>user2</ranknum>
<credit>100</credit>
<ReplyID>4620141</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>50822</PostUserId>
<PostUserName>coaa</PostUserName>
<Point>0</Point>
<Content>其实可以看看design pattern这本书讲一些设计思想的,有java的英文版.</Content>
<PostDateTime>2002-5-8 15:24:35</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>紫剑伊</PostUserNickName>
<rank>四级(中级)</rank>
<ranknum>user4</ranknum>
<credit>100</credit>
<ReplyID>4626394</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>116191</PostUserId>
<PostUserName>zijianyi</PostUserName>
<Point>0</Point>
<Content>好复杂呀,我现在也是jsp+bean的阶段,对ejb,j2ee不知道应该怎么入门,不知道ejb和javabean有什么区别
别告诉我看tij:)</Content>
<PostDateTime>2002-5-8 20:55:34</PostDateTime>
</Reply>
<Reply>
<PostUserNickName>态度决定一切,java支配世界</PostUserNickName>
<rank>三级(初级)</rank>
<ranknum>user3</ranknum>
<credit>100</credit>
<ReplyID>4654769</ReplyID>
<TopicID>701502</TopicID>
<PostUserId>28250</PostUserId>
<PostUserName>Yang_Sun</PostUserName>
<Point>20</Point>
<Content>呵呵,ejb是enterprise java bean,是j2ee的标准,javabean已经被俗话了,现在的javabean大家都是指jsp中加入类,而实际javabean是一个非常牛的规范,javabean和ejb是毫无关系的,你看看www.theserverside.com上的一本叫做mastering ejb2的书,就明白ejb的意思了,不过,如果你的企业很小的话,估计一辈子都没机会部署ejb的。</Content>
<PostDateTime>2002-5-10 14:32:14</PostDateTime>
</Reply>
</Replys>
</Topic>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -