Something like this might work:

<bean:define id="actionMappingForThisScreen"
name="org.apache.struts.action.mapping.instance"
type="org.apache.struts.action.ActionMapping"/>
<bean:define id="formName" name="actionMappingForThisScreen" property="name"
type="java.lang.String" />
<bean:define id="formBean" name="<%= formName %>"
type="org.apache.struts.action.ActionForm"/>

I haven't tested it, but i *think* it'll work since i *think* the
current action mapping is stored in the request under the key
"org.apache.struts.action.mapping.instance".  The above code should help you
get the form bean's name and a reference to the bean itself.

chris

> -----Original Message-----
> From: Charles McClain [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 20, 2002 11:13 AM
> To: Struts User Mailing List
> Subject: Re-using JSP pages -- Follow-up
> 
> 
> All:
> 
> This is a follow-up to my earlier post on the same topic.  Although I
> received a response, I think it wasn't the response I needed because I
> didn't ask my question correctly.
> 
> Boiled down -- and ignoring all the background of why I need it, which
> may have confused people -- I want:
> 
> --  To pass different form-beans to the same JSP;
> --  To have the JSP figure out the name of the form-bean it 
> received, so
> it can use that form-bean name in various tags.
> 
> I'm sure the form-bean name must be easily available to the JSP, but I
> have searched the Struts User Guide and the taglib 
> documentation, and I
> can't figure out how .  Can anyone help?
> 
> Thanks again in advance.  You guys were very responsive before; I just
> needed to phrase my question more simply.
> 
> Charles McClain
> Phone:  603.659.2046
> email:    [EMAIL PROTECTED]
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

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

Reply via email to