struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Maurer <joerg.mau...@ucpmorgen.com>
Subject RE: Obtaining valid ModuleConfig.
Date Wed, 29 Jan 2003 14:11:40 GMT
Is it really in request context? sounds more for application context!

-----Original Message-----
From: James Nord [mailto:teilo@teilo.net]
Sent: Mittwoch, 29. Jänner 2003 15:13
To: struts-user@jakarta.apache.org
Subject: Obtaining valid ModuleConfig.



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


---------------------------------------------------------------------
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