On Mon, 25 Jun 2001, Kief Morris wrote:

> I'm making my first Struts application, and in keeping with MVC 
> I want to load all of my JSP pages through actions: the Action sets 
> up the data the JSP page needs to display. 
> 
> It seems that the <action> tag in struts-config.xml requires a form 
> bean for the name="" attribute. But what if I have a view which is not 
> a form, merely a view of data? A form bean shouldn't be necessary
> for this, so how do I structure this?
> 

If you have an action that does not need a form bean, simply omit the
"name" attribute.  This will cause the automatic processing that Struts
normally performs for form beans to be skipped.

Note that all of the <bean:xxx> and <logic:xxx> tags work quite well on
arbitrary JavaBeans in any scope.  Therefore, a common design pattern will
be to call an Action that goes and collects all the needed information,
and exposes it as one or more beans, followed by a forward to the JSP page
that uses those beans to create the dynamic view.

> Kief
> 
> 

Craig


Reply via email to