Hi

I have a template jsp file which on the side bar displays the Latest News.
The latest news is retrieved from the database. I can do a database access
from the JSP or from a custom taglib, but this does not follow the MVC
pattern.

So, what I have done is have a BaseAction class this extends Struts' action
calss. This class performs the datbase access and fills in the data in the
BaseForm class (which extends Struts' ActionForm class).

This all sounds fine, but Struts does not allow me to access the parent
class (BaseForm) from the JSP, if it is not defined for a particular action.
Eg

                <action path="/test" type="TestAction" name="testForm" scope="request"
validate="false" >
                        <forward name="success" path="/success.jsp" redirect="false"/>
                </action>

Here, TestForm extends from BaseForm, but in Struts' ActionServlet class, it
only compares the name of the form, so the news jsp cannot see BaseForm,
only TestForm.

One solution is to put the name of the form in the session so that the news
jsp knows which form to get the data from. But this gets too messy.

It would be really nice if I can declare a global form that gets tagged to
all actions. Now, the jsps in the 'side' template jsp can access this global
form, and the jsps in the 'body' templage jsp can access the actual forms.

Any other thoughts on this?

Keith


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

Reply via email to