Here's a working version - now if we can only get the committers to add
it ;) nudge, nudge

Matt

> -----Original Message-----
> From: Erik Hatcher [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, January 08, 2003 7:52 AM
> To: Struts Developers List
> Subject: Re: How do I get a form's name within <html:form>?
> 
> 
> Ok, I understand now... yes, thats a flaw in my LabelTag of 
> course and 
> it should take into account the form bean on the page, not the action 
> mapping.
> 
> Let me know if you beat me to a fix.  I don't have situations where 
> this has caused an NPE for me (yet), but would like to make sure its 
> robust enough for others to use.
> 
>       Erik
> 
> 
> On Wednesday, January 8, 2003, at 09:41  AM, Matt Raible wrote:
> >> Matt - that seems like a reasonable change to me, although 
> maybe its 
> >> even more robust to find the parent form tag and call the
> >> getBeanName()
> >> method there?
> >>
> >> I haven't had a chance to try the change to see how it affects my 
> >> project yet though.
> >>
> >> I'm confused on why your ActionForward action doesn't have a form 
> >> bean associated with it though.  How does the <html:form> tag know 
> >> what form to use then?
> >
> > My ActionForward is thus:
> >
> >     <action
> >         path="/userProfile"
> >         type="org.apache.struts.actions.ForwardAction"
> >         parameter="userProfile"/>
> >
> > So there is not formBean on it - I suppose I could add one - but the
> > form
> > where I'm getting the NPE *does* have a mapping with a formBean.  
> > Here's my form:
> >
> > <html:form action="editUser" focus="firstName"
> >     styleId="userForm" onsubmit="return validateUserForm(this)">
> >
> > And the action-mapping for it:
> >
> >     <action
> >       path="/editUser"
> >       type="org.appfuse.webapp.action.UserAction"
> >       name="userForm"
> >       scope="session"
> >       input="mainMenu"
> >       parameter="action"
> >       unknown="false"
> >       validate="false"
> >>
> >
> > I realize - what the heck are you using session scope for?? - but I
> > think
> > people might use this in the real-world, and it'd be cool if the 
> > LabelTag
> > allowed for it.
> >
> > Hope this helps to explain my problem better.
> >
> > Matt
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-dev-> [EMAIL PROTECTED]>
> For 
> additional commands, 
> e-mail: <mailto:[EMAIL PROTECTED]>
> 

Attachment: LabelTag.java
Description: Binary data

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

Reply via email to