You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jörg Maurer <jo...@ucpmorgen.com> on 2003/01/29 15:11:40 UTC
RE: Obtaining valid ModuleConfig.
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