Struts best practices suggest that an action handles a request (with
or without input data), while a JSP page is simply a data-aware HTML.
Look at it this way: by calling an action instead of calling JSP
directly you are asking for a resource to render itself according to
its current state. If you called JSP directly, you would be asking to
display a specific view of a resource, while this view may not
correspond to resource state anymore.

If you have 1:1 relationship between actions and pages, using JSP
directly is basically the same thing, but you need to initialize your
backing bean... sorry, your actionform or fromever you pull the data,
anyway. This also works, if your resource can have several states, but
views for all states are defined in one JSP page as subviews.

The "view helper" approach described here is not popular among Struts
users, but is used in other frameworks like Stripes.

Michael J.

On 1/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> My question concerns jsp pages that provide a read only view of data.  In 
> other words, there won't be a form submitted from the page.  Is there a 
> compelling reason to use an action form in these cases.  I've just been using 
> tags such as c:out with my own beans put in scope.  I've noticed that some 
> people use the ActionForm and jsp form tags to do this same data transfer.  
> That's strikes me as using the forms not necessarily in the way they were 
> meant to be.  But I'll admit to not being entirely clear on what seems to be 
> a simple topic, actionForms that is.  Any recommendations, with pros and cons.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to