You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Lacerda, Wellington (AFIS)" <We...@fao.org> on 2000/09/19 17:51:27 UTC
RE: Is struts a hybrid or page-centric and servlet-centric design ?
Servlet-centric versus JSP-centric sounds to me as an inherited
nomenclature from Model 1 times, when nobody really knew how to use Jsps and
Servlets together and everybody used either servlets (servlet-centric) or
Jsps (jsp centric) and mixing them was really confusing.
The model 2 architecture is based in the model-view-control design pattern.
Struts translates this design pattern putting:
- a servlet as a controller (the ACTION Servlet),
- JSP as view, boosted with struts tag libraries
- Beans as model (in fact, you can use anything as model, provided it
can be reached by your ActionForm classes).
To avoid having the Action Servlet enormous and impossible to maintain,
struts adopts a model of delegation in the control layer, better said, the
action servlet delegates the resolution of the control to the actionForm
objects, which will perform the actions needed to fulfil the request. They
then redirect the presentation of the response back to the proper JSP.
That's my understanding of struts, so far.
It doesn't seem to make sense call a model 2 system servlet or jsp centric,
I think the categorisation just doesn't apply. I mean, it CAN'T BE servlet
centric when the servlet is only the controller and even delegates the
resolution of a request to other classes. It CAN'T BE JSP centric because
the JSPs don't resolve the requests. It certainly CAN'T BE BOTH for the
reason below:
A JSP system CAN'T BE JSP centric, because JSPs ARE servlets, after all, so
any JSP centric system is, in fact, Servlet centric ;D
Wellington Silva
UN/FAO
-----Original Message-----
From: Bergenholtz, Erik [mailto:bergen@Bluestone.com]
Sent: Tuesday, September 19, 2000 5:18 PM
To: 'struts-user@jakarta.apache.org'
Subject: RE: Is struts a hybrid or page-centric and
servlet-centric design ?
I would say that Struts is neither page nor servlet centric
(which implies
Hybrid by your definition). Out of the box, Struts uses a
servlet that acts
as the controller, and beans as the model, and finally JSPs
as the View.
The cool thing about Struts is that you can make it anything
that you want.
The framework can be extended to use servlets at all levels
of processing or
JSPs for that matter; and still leverage the benefits of the
framework
(localizing flow, divorcing your business components from
the web
environment, validation, i18n etc).
my 2 cents,
Erik
-----Original Message-----
From: Leland, Robert [mailto:rleland@cghtech.com]
Sent: Monday, September 18, 2000 7:50 PM
To: 'struts-user@jakarta.apache.org'
Subject: Is struts a hybrid or page-centric and
servlet-centric design ?
Hi,
Struts looks pretty comprehensive even if it were a 2.0
framework, and its
just a 1.0 beta/gamma !
I am a bit confused though, and hope someone could help me
out ?
In looking over the struts documentation, it would seem to
indicate that
struts is a Model 2, servlet-centric design ?
I say servlet-centric after reading the book:
Web Development with Java Server Pages
Chapter 8, Architecting JSP applications.
In looking at the struts model
diagram with the one in WDJSP on page 220, they look
identical.
In that chapter what the author called servlet-centric one
of the key
characteristics of:
Data from a jsp page is always passed via Post, and one
jsp
page never knows about the other. This hides the actual
URL
from the user keeping them from bookmarking
and using the <- and -> arrows.
However in the /struts-example mainMenu.jsp struts .do
commands are
passed via a URL such as
editRegistration.do?action=Edit,
are used to pass data. Thus users could bookmark it.
Does this mean struts is a hybrid somewhere between
page-centric and servlet-centric design ?
Thanks !!!
-Rob