tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Shraibman <...@selectacast.net>
Subject How to get the offending uri when handling a 404 error?
Date Tue, 01 Jun 2004 23:56:46 GMT
I put this in my web.xml:

<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>

... and this in 404.jsp:

ErrorData ed = pageContext.getErrorData();
if (ed != null) url = ed.getRequestURI() ;

but it throws:

StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
java.lang.NullPointerException
         at javax.servlet.jsp.PageContext.getErrorData(PageContext.java:514)
         at org.apache.jsp._404_jsp._jspService(_404_jsp.java:102)
         at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
         at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

(this is with tomcat 5.0.24)

So how can I get the url the the user tried to request?

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


Mime
View raw message