I have a need to include in one JSP a second JSP that requries
preprocessing.
I think this is similar to Action chaining but I would appreciate some
comments
or other solutions if anyone has them. 
-------------------------------------
The problem:
One may not do this: <jsp:include page="/Action2.do"/>
So how does preload data for an included JSP?

In my case the nested action call is known, as in the link
<html:link href="Action1.do?nestedAction=/Action2">Go</html:link>

In Action1.execute, I gather the nestedAction parameter as a mapping path,
and, using the ActionServlet, call processMapping using the parameter value.
Then processActionCreate, processActionForm, processPopulate and finally 
processActionPerform to retrieve the ActionForward. The path for this
forward
is set as a request attribute ('Action2') and Action1 continues to execute
and return its
own ActionForward. 

Thus, by the time the JSP is rendered, the appropriate include can be made
directly
<jsp:include page='<bean:write name="Action2"/>'/>
with the assurance that the nested JSP has all the data it needs already in
accessible beans.
--------------------------
Note:In fact one can pass all ActionMapping paths to be executed as 
parameters in the request. This loads all of their beans and returns the
ActionForward for its display. 
----------------------------
Q:
This is a Struts1.1beta1 solution. Does anyone know of a Struts 1.0
solution?
Is there a better way of doing this?

replies much appreciated

Toby Steel
www.Jonahgroup.com

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

Reply via email to