struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tapan Nanawati <>
Subject Error in CheckApp - CheckLoginTag - Sample example mail application
Date Tue, 01 Apr 2003 07:47:51 GMT
Hi friends,
I am working on struts -1.1 rc and tomcat 4.0.6.
I have installed  mail registration application and it is working fine.
I can see all the pages properly.

However if I open a new browser window and type the URL direcly :-

I get a null pointer instead of sending me to a login page.

javax.servlet.ServletException: java.lang.NullPointerException
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$
at org.apache.jasper.runtime.HttpJspBase.service(
Cont  ~~~~~~~~~~~~
root cause
javax.servlet.jsp.JspException: java.lang.NullPointerException
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(

I tried to debug and found that :
In the below method, in the request.getAttribute()
ModuleConfig config = (ModuleConfig) pageContext.getRequest()	

The *attribute* is not available and hence the null pointer.

Pleaese suggest how can I have org.apache.struts.Globals.MODULE_KEY in
the request.

   public int doEndTag() throws JspException {

	// Is there a valid user logged on?
	boolean valid = false;
	HttpSession session = pageContext.getSession();
	if ((session != null) && (session.getAttribute(name) != null))
	    valid = true;

// ERROR - null
System.out.println( "MODULE ~~ PC "+
pageContext.getRequest().getAttribute(org.apache.struts.Globals.MODULE_KEY); );

	// Forward control based on the results
	if (valid)
	    return (EVAL_PAGE);
	else {
            ModuleConfig config = (ModuleConfig)
            try {
		pageContext.forward(config.getPrefix() + page);
	    } catch (Exception e) {
		throw new JspException(e.toString());
	    return (SKIP_PAGE);


Please suggest.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message