There are 2 ways, and I did both, just to be anal
and because I didn't know which was best.

  FormTag form = (FormTag) pageContext.
      getAttribute(Constants.FORM_KEY, PageContext.REQUEST_SCOPE);
  if (form == null)
      form = (FormTag) findAncestorWithClass(this, FormTag.class);
  if (form == null)
      throw new JspException("...");
  String formName = form.getBeanName();

- Dan

> -----Original Message-----
> From: Jarnot Kari Contr HQ SSG/STN [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 08, 2003 5:57 AM
> To: Struts Users Mailing List
> Subject: RE: getting the form name
> 
> 
> You could do this:
> FormTag htmlForm = (FormTag) TagSupport.findAncestorWithClass(this,
> FormTag.class);
> String actionFormName = htmlForm.getBeanName();
> 
> -----Original Message-----
> From: Arne Brutschy [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 08, 2003 7:42 AM
> To: Struts Users Mailing List
> Subject: getting the form name
> 
> 
> Hello,
> 
> I'm trying to subclass the TextTag.java. I need to get the form name 
> assiciated with this input field. How can I retrieve this? As I 
> understand it right, the form field gets the name of the form 
> from the 
> associated actionmapping. But how can I get the form tag, the 
> text tag 
> is nested in?
> 
> Regards,
> Arne
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

Reply via email to