I'm looking to do some enhacements to Erik Hatcher's LabelTag.  Currently,
it gets a form's name with the following code:

ActionMapping mapping =
    (ActionMapping) pageContext.getAttribute(
        Globals.MAPPING_KEY,
        PageContext.REQUEST_SCOPE);
String formName = mapping.getAttribute();

However, this only works if there is a mapping the request scope.  I've run
into a couple NPE on pages that are forwarded to using an ActionForward -
and the form still renders (without the LabelTag).  So I'm wondering how I
can get the form's name if I'm within an <html:form>?

After looking at FormTag.java, is this the best way?

String formName = (String) pageContext.getAttribute(Constants.BEAN_KEY,
PageContext.REQUEST_SCOPE);

Feel free to send me a link to CVS to view the source for a class there.

Thanks,

Matt


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

Reply via email to