You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "McRobb, John" <Jo...@tescopf.com> on 2003/03/18 15:39:23 UTC

pageContext is null?

I am writing a custom Tag:

public class InRoleTag extends ConditionalTagBase 

I try and get the roles but it appears that the pageContext is null

ServletRequest req = null;
        if (pageContext != null) {
          req = pageContext.getRequest();
        }
        else
          System.out.println("page Context was null");
          
        if (req != null) {
           Enumeration e = req.getAttributeNames();
           while(e.hasMoreElements())
              System.out.println(e.nextElement().toString());
        }
        else
           System.out.println("request was null");
        
        if (config == null) { // Backwards compatibility hack
            config = (ApplicationConfig)
                pageContext.getServletContext().getAttribute
                (Action.APPLICATION_KEY);
        }

I got a null pointer exception previously and with the trace above it is
down to the pageConext being null.
It's on WebSphere 4.04 Single Server Edition.

Thanks

John

> John McRobb
> Tesco Personal Finance
52 West Register Street, Edinburgh, EH2 2AA
> *:  mailto:john.McRobb@tescopf.com
> *:  0131 523 9382  (Internal: x29382)
> 


Tesco Personal Finance Limited is a joint venture between The Royal Bank of Scotland plc and Tesco PLC. Tesco Personal Finance Limited is registered in Scotland No 173199. Registered Office: 42 St Andrew Square, Edinburgh EH2 2YE. 

This e-mail message is confidential and for use by the addressee only. If you are not the addressee, please return the message to the sender by replying to it and then delete the message from your computer. 

Internet e-mails are not necessarily secure. Tesco Personal Finance Limited does not accept responsibility for changes made to this message after it was sent.


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