struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Nord <te...@teilo.net>
Subject Obtaining valid ModuleConfig.
Date Wed, 29 Jan 2003 14:12:43 GMT

Hi,

I'm using the following snippet in taglib code but it fails as 
config==null.  (Stuts 1.1 b3)

         public int doEndTag() throws JspException {
            <snip>
            ModuleConfig config = (ModuleConfig) pageContext.getRequest()
                .getAttribute(org.apache.struts.Globals.MODULE_KEY);
            if (config == null) {
                System.out.println("config  == null");
            }
            if (config.getPrefix() == null) {
                System.out.println("config.getPrefix() == null");
            }
            try {
                pageContext.forward(config.getPrefix() + page);
            } catch (Exception e) {
                throw new JspException(e.toString());
          }
          return (SKIP_PAGE);
        }

The code is based on the example that comes with struts.  I presume I'm 
missing something obvious but I'm new to Struts and can't track it down.
Could someone give me some pointers before I tear all my hair out ;-)

Regards

    /James


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message