You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/04/08 07:11:22 UTC

DO NOT REPLY [Bug 18794] New: - Module Config / org.apache.struts.Globals.MODULE_KEY / Null Pointer

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18794>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18794

Module Config / org.apache.struts.Globals.MODULE_KEY / Null Pointer

           Summary: Module Config / org.apache.struts.Globals.MODULE_KEY /
                    Null Pointer
           Product: Struts
           Version: 1.1 RC1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Standard Actions
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: daniel@osmosislatina.com


I encountered the following bug, which can be replicated in the example
application, its regarding MODULE_KEY. 

In the example the code can be found in the CheckLogonTag class: 

 ModuleConfig config = (ModuleConfig) pageContext.getRequest()
                .getAttribute(org.apache.struts.Globals.MODULE_KEY);
            try {
		pageContext.forward(config.getPrefix() + page);
	    } catch (Exception e) {
		throw new JspException(e.toString());
	    }
	
The snippet should redirect you to the indicated page, however, it returns a
NullPointer, when you substitue the "config.getPrexif()" with a hardcoded URL it
redirects accordingly. It seems there is no available attribute for
org.apache.struts.Globals.MODULE_KEY.

To replicate this error in the example (without logging-in), just visit a JSP
that's not the index, like:

http://struts.org/struts-example/subscription.jsp

You get a null pointer error; as mentioned above, if you hard-code
config.getPrefix for the Class , the null pointer is not thrown. 

I have tried this setup with RC1.1, and Tomcat containers 4.1.10 and 4.1.24

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