You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Roman V. Petrov" <po...@actimind.com> on 2002/02/15 18:59:08 UTC
MVC and Struts
Struts gurus and users,
I used Struts in several projects and have a question about Struts design.
If consider a Struts application with separated business
layer (like EJB or another way) as MVC example I see:
ActionServlet - Controller
Action - mixed Controller + View
JSP with tags - View
FormBean - Model
EJB - Model
I think Action has View functions because it is responsible
for getting Model state from EJB and constructing special
view beans for JSP.
And why Struts goes JSP-way to the future?
I consider JSP tags is not better solution to render the View.
What about integration with XSLT?
I found two solutions to integrate XSL and Struts
http://www.openroad.ca/opencode/index.html
http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt.html
However both have not clear push-MVC model.
I think about Struts extension like this:
http://poma.spb.ru/design/collaboration.gif
Here:
RequestDispatcher(ActionServlet), FormBean, Action, View - java classes
XSL stylesheet - precompiled XSL
I'm interested about any Struts users and developers opinion.
Sincerely yours, Roman Petrov
</></></></></></></></></></></></></></></></></></></></>
Software Engineer Actimind, Inc.
Software Development Department http://www.actimind.com
E-mail: poma@actimind.com Saint-Petersburg
Phone: +7-(812)-325-87-16(ask 108) Russia
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re[2]: MVC and Struts
Posted by "Roman V. Petrov" <po...@actimind.com>.
TH> Struts has always been open to other presentation systems.
TH> It's just
TH> been a matter of someone doing the work to expose the Struts
TH> configuration to those systems. The custom tags and RequestUtils package
TH> did that for JSP.
It's not clear for Struts beginners.
I think Struts should not press user to select JSP.
Do you plan to divide Struts to Action part and JSP support?
TH> Other servlets like X2 (from the JavaWorld article),
TH> and the Struts/Velocity servlet are making it available to other systems
TH> now.
Have had X2 the release or alpha? Have you contact to the developers?
I want to help them.
TH> For JSP, another servlet is not required, since the JSP service is
TH> already provided by the container. For other presentation systems, it is
TH> just a matter of adding a presentation servlet, like the XLST X2
TH> servlket or the one provided by the Velocity team. The internal Struts
TH> packages (except for RequestUtils) are view neutral, and should work
TH> equally well with anything.
Good idea.
TH> In Struts 1.1, we're working on a "API bean" that will make the
TH> configuration readily available to other systems, including JSTL.
JSTL? It's about tiles? Can I find the API in nightly build?
TH> The Action is part of the controller layer. It bundles model data into a
TH> bean for the benefit of the presentation layer, but does not itself
TH> contain any presentation logic (e.g. HTML code). Here, it is following
TH> the layers pattern,
TH> [view] <-> [controller] <-> [model]
Hm. Why not [controller] <-> [model] and
[view] <-> [model]?
At present in the Struts I should write Action for any View that
requires to load data from the Model.
I think the View from pull-MVC has two main responsibilities:
1. Load data from the Model and prepare for render(java task)
2. Render loaded data with JSP or XSL or..
Am I wrong?
Sincerely yours, Roman Petrov
</></></></></></></></></></></></></></></></></></></></>
Software Engineer Actimind, Inc.
Software Development Department http://www.actimind.com
E-mail: poma@actimind.com Saint-Petersburg
Phone: +7-(812)-325-87-16(ask 108) Russia
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MVC and Struts
Posted by Ted Husted <hu...@apache.org>.
Struts has always been open to other presentation systems. It's just
been a matter of someone doing the work to expose the Struts
configuration to those systems. The custom tags and RequestUtils package
did that for JSP. Other servlets like X2 (from the JavaWorld article),
and the Struts/Velocity servlet are making it available to other systems
now.
For JSP, another servlet is not required, since the JSP service is
already provided by the container. For other presentation systems, it is
just a matter of adding a presentation servlet, like the XLST X2
servlket or the one provided by the Velocity team. The internal Struts
packages (except for RequestUtils) are view neutral, and should work
equally well with anything.
In Struts 1.1, we're working on a "API bean" that will make the
configuration readily available to other systems, including JSTL.
The framework is biased toward standard Java technologies, like
JavaBeans, but not to a particular presentation system.
The Action is part of the controller layer. It bundles model data into a
bean for the benefit of the presentation layer, but does not itself
contain any presentation logic (e.g. HTML code). Here, it is following
the layers pattern,
[view] <-> [controller] <-> [model]
The ActionForm bean is a view object, but the View and Controller can
interact because they are on adjascent layers.
The base ActionForm bean object is a view-neutral JavaBean. It can be
used by a Velocity template, JSP, or anywhere JavaBeans can be used.
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/
"Roman V. Petrov" wrote:
>
> Struts gurus and users,
>
> I used Struts in several projects and have a question about Struts design.
> If consider a Struts application with separated business
> layer (like EJB or another way) as MVC example I see:
>
> ActionServlet - Controller
> Action - mixed Controller + View
> JSP with tags - View
> FormBean - Model
> EJB - Model
>
> I think Action has View functions because it is responsible
> for getting Model state from EJB and constructing special
> view beans for JSP.
> And why Struts goes JSP-way to the future?
> I consider JSP tags is not better solution to render the View.
> What about integration with XSLT?
>
> I found two solutions to integrate XSL and Struts
> http://www.openroad.ca/opencode/index.html
> http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt.html
> However both have not clear push-MVC model.
>
> I think about Struts extension like this:
> http://poma.spb.ru/design/collaboration.gif
> Here:
> RequestDispatcher(ActionServlet), FormBean, Action, View - java classes
> XSL stylesheet - precompiled XSL
>
> I'm interested about any Struts users and developers opinion.
>
> Sincerely yours, Roman Petrov
>
> </></></></></></></></></></></></></></></></></></></></>
> Software Engineer Actimind, Inc.
> Software Development Department http://www.actimind.com
> E-mail: poma@actimind.com Saint-Petersburg
> Phone: +7-(812)-325-87-16(ask 108) Russia
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>