由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Question about Model 2
相关主题
display an image from db along with other text on jspTomcat Servlet: synchronized vs non-synchronized methods
FrameworkServlet?哪位大牛可以总结一下各种java框架的基本思想,优于其它框架的地方以及适用范围。
J2EE和未来工作问题使用JAVA的一则经验和教训
interview求助jBuiler 4白皮书(来自inprise网站)
现在 Java Web 开发过时了么?Swing GUI vs JSP Web Solution
唉进了一家烂公司help needed
疯了!J2EE应该到哪里找工作?找在servlet里处理上传文件的包
求推荐Java developer summer intern position怎么在servlet里得到请求JSP的相对路径?
相关话题的讨论汇总
话题: jsp话题: servlet话题: mvc话题: what话题: model
进入Java版参与讨论
1 (共1页)




while the controllers (action class) define where you can the backendData,
for example, SController.execute() would call SBusDelegate.getData()...
what UI framework u use?

【在 A**o 的大作中提到】
: and some kind of weaving involved around jsp was invoked?
k***r
发帖数: 4260
1
I'm still new to the Java web stuff. I'm just curious,
in Mode 2, a servlet is the entry point of a request, then
it forwards the request to a JSP, then the JSP calls the
beans. I wonder what's the benefit of using a servlet as
the entry point? Can't people just access the JSP? This
way code can still be shared in the beans.
A**o
发帖数: 1550
2
the point is you don't want to put business logics into jsp. you want jsp as
close as it could to be like a html page.
k***r
发帖数: 4260
3
I understand that. But what's wrong with using an HTML
as an entry point? I think a page usually displays some
information (which is what HTML does best), then the
user can take an action (which a bean does best.) So
landing at an HTML/JSP page, and invoke a bean from there
sounds natural to me. I'm still not sure what business
logic has to be done in the page that requires a servlet.

【在 A**o 的大作中提到】
: the point is you don't want to put business logics into jsp. you want jsp as
: close as it could to be like a html page.

F****n
发帖数: 3271
4
Firstly, MVC is only optional. For simple applications you don't need MVC
and you can access control logic just as what you said.
Secondly MVC is a design model. All the benefits is from the designer or
developer's point of view. There's no user benefits nor performance gain (
and sometimes it actually results in performance loss).
Thirdly, the benefits of MVC (more specifically the separation of control
and presentation) are obvious. Just imagine you want a new Web Page for your
site. Because y

【在 k***r 的大作中提到】
: I'm still new to the Java web stuff. I'm just curious,
: in Mode 2, a servlet is the entry point of a request, then
: it forwards the request to a JSP, then the JSP calls the
: beans. I wonder what's the benefit of using a servlet as
: the entry point? Can't people just access the JSP? This
: way code can still be shared in the beans.

k***r
发帖数: 4260
5
Thanks for the reply. I think I must be missing something
though. Let's say we have a JSP and a bean in a servlet.
And we don't use a servlet as an entry point instead we
land at the JSP. Isn't that also perfectly separating view
and controller/model?
I think I'm not very clear about the controller rule yet.
It sounds like a dispatch if the first servlet is the controller.
It doesn't really do much, as far as I can see.
To me, the JSP is still the view, and you can have as many
of them as you wa

【在 F****n 的大作中提到】
: Firstly, MVC is only optional. For simple applications you don't need MVC
: and you can access control logic just as what you said.
: Secondly MVC is a design model. All the benefits is from the designer or
: developer's point of view. There's no user benefits nor performance gain (
: and sometimes it actually results in performance loss).
: Thirdly, the benefits of MVC (more specifically the separation of control
: and presentation) are obvious. Just imagine you want a new Web Page for your
: site. Because y

A**o
发帖数: 1550
6
what are you going to do with the first jsp?
what if you need to db query to populate a table?
what if your behavior is different depending on the people's role?
as Foxman has said, if it's a "simple" application, it's ok whatever you
want to do.

【在 k***r 的大作中提到】
: Thanks for the reply. I think I must be missing something
: though. Let's say we have a JSP and a bean in a servlet.
: And we don't use a servlet as an entry point instead we
: land at the JSP. Isn't that also perfectly separating view
: and controller/model?
: I think I'm not very clear about the controller rule yet.
: It sounds like a dispatch if the first servlet is the controller.
: It doesn't really do much, as far as I can see.
: To me, the JSP is still the view, and you can have as many
: of them as you wa

b******y
发帖数: 1684
7
huh? why can't it be jsp as entry point?

【在 k***r 的大作中提到】
: I'm still new to the Java web stuff. I'm just curious,
: in Mode 2, a servlet is the entry point of a request, then
: it forwards the request to a JSP, then the JSP calls the
: beans. I wonder what's the benefit of using a servlet as
: the entry point? Can't people just access the JSP? This
: way code can still be shared in the beans.

b******y
发帖数: 1684
8
in this case, what's the difference between using jsp and servlet?
using jsp with frameworks like struts2, you can also decouple
business logic from presentation.

【在 A**o 的大作中提到】
: what are you going to do with the first jsp?
: what if you need to db query to populate a table?
: what if your behavior is different depending on the people's role?
: as Foxman has said, if it's a "simple" application, it's ok whatever you
: want to do.

A**o
发帖数: 1550
9
i haven't done struts2 yet. so what do they do in task separation?

【在 b******y 的大作中提到】
: in this case, what's the difference between using jsp and servlet?
: using jsp with frameworks like struts2, you can also decouple
: business logic from presentation.

b******y
发帖数: 1684
10
typical MVC based framework, jsp takes care of the view

【在 A**o 的大作中提到】
: i haven't done struts2 yet. so what do they do in task separation?
相关主题
唉进了一家烂公司Tomcat Servlet: synchronized vs non-synchronized methods
疯了!J2EE应该到哪里找工作?哪位大牛可以总结一下各种java框架的基本思想,优于其它框架的地方以及适用范围。
求推荐Java developer summer intern position使用JAVA的一则经验和教训
进入Java版参与讨论
A**o
发帖数: 1550
11
and some kind of weaving involved around jsp was invoked?

【在 b******y 的大作中提到】
: typical MVC based framework, jsp takes care of the view
b******y
发帖数: 1684
12
not sure what u r talking about.....
but let me try to answer...
basically for the data part, the jsp page would have things like

backendData.field1
backendData.field2
backendData.field3
A**o
发帖数: 1550
13
thanks for the example. need further detail like when and how the execute
will be called. but i'll look it up myself if i really need it.
i'm using struts 1.x. used stripes before which was way better than struts 1
.x in my opinion and limited experience. however, you don't always have the
freedom to choose which framework you are going to use. you are picked to
use some framework, mostly.
b******y
发帖数: 1684
14
struts2 tech is more like webwork than struts1
i think it's called struts2 rather than webwork3 due to struts1's popularity.
i used something called burecuda framework before...
it sucks big time. got lost in its event files easily.

1
the

【在 A**o 的大作中提到】
: thanks for the example. need further detail like when and how the execute
: will be called. but i'll look it up myself if i really need it.
: i'm using struts 1.x. used stripes before which was way better than struts 1
: .x in my opinion and limited experience. however, you don't always have the
: freedom to choose which framework you are going to use. you are picked to
: use some framework, mostly.

g*****g
发帖数: 34805
15
This is just basic MVC pattern, and the main benefit being that
you can have multiple views with the same controller and model.
Gmail has an ajax version and a plain html version. Now imagine
you have control logic such as delete a message in the view.
You have to duplicate the code in 2 places. Yes, you can abstract
the shared logic to another class, but any logic may be used
in multiple places in the future. So you end up getting all your
control logic out of your view, and servlet becomes a n

【在 k***r 的大作中提到】
: I'm still new to the Java web stuff. I'm just curious,
: in Mode 2, a servlet is the entry point of a request, then
: it forwards the request to a JSP, then the JSP calls the
: beans. I wonder what's the benefit of using a servlet as
: the entry point? Can't people just access the JSP? This
: way code can still be shared in the beans.

s******e
发帖数: 493
16
for a trivial web application, using jsp as the entry point is not a problem
, evetually a jsp will be converted into a servlet anyway.
But for a big web application, even mvc is not enough. if you knew the
histroy, you would know that was the main reason sun introduced view layer
J2ee design patterns such as service to woker, dispatcher... They want you
to avoid the duplicated code and to centralize the cross cutting concerns
such as session management, application level transaction management.
k***r
发帖数: 4260
17
Thanks for all the replies. 偶要消化一下。
s******n
发帖数: 876
18
maybe you were right and they are wrong.
billions of ASPs and PHPs serve the internet just fine.

【在 k***r 的大作中提到】
: Thanks for all the replies. 偶要消化一下。
F****n
发帖数: 3271
19
Why you think MVC does not work in ASP or PHP?

【在 s******n 的大作中提到】
: maybe you were right and they are wrong.
: billions of ASPs and PHPs serve the internet just fine.

s******n
发帖数: 876
20
why do you think i think so?

【在 F****n 的大作中提到】
: Why you think MVC does not work in ASP or PHP?
相关主题
jBuiler 4白皮书(来自inprise网站)找在servlet里处理上传文件的包
Swing GUI vs JSP Web Solution怎么在servlet里得到请求JSP的相对路径?
help needed[转载] 请推荐关于Servlet和JSP编程的书
进入Java版参与讨论
F****n
发帖数: 3271
21
Because you use "millions of ASP or PHP" as evidence against MVC.

【在 s******n 的大作中提到】
: why do you think i think so?
s******n
发帖数: 876
22
no I did not.

【在 F****n 的大作中提到】
: Because you use "millions of ASP or PHP" as evidence against MVC.
b******y
发帖数: 1684
23
then what did u mean?

【在 s******n 的大作中提到】
: no I did not.
1 (共1页)
进入Java版参与讨论
相关主题
怎么在servlet里得到请求JSP的相对路径?现在 Java Web 开发过时了么?
[转载] 请推荐关于Servlet和JSP编程的书唉进了一家烂公司
请教一下JSP+SERVLET结构的进阶教材,多谢了疯了!J2EE应该到哪里找工作?
JB JAVA Bean,SERVLET位置一问求推荐Java developer summer intern position
display an image from db along with other text on jspTomcat Servlet: synchronized vs non-synchronized methods
FrameworkServlet?哪位大牛可以总结一下各种java框架的基本思想,优于其它框架的地方以及适用范围。
J2EE和未来工作问题使用JAVA的一则经验和教训
interview求助jBuiler 4白皮书(来自inprise网站)
相关话题的讨论汇总
话题: jsp话题: servlet话题: mvc话题: what话题: model