• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ideas for a good 404 errorpage

 
Mark Wa
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have an error page which I have set my web.xml (DD) up to go to, on the event of a HTTP404. I have it telling me the referer, but what i'm mostly after is the URL that cannot be found.

Does anyone know how I can get this?

(all I seem to end up with is the url of the errorpage with whatever method I try.)
 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you have a page directive with its isErrorPage attribute set to true, what do you get from either of these:

${requestScope["javax.servlet.error.request_uri"]}
${pageContext.errorData.requestURI}
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the error handling section of the Servlet Specification for more details.
 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:See the error handling section of the Servlet Specification for more details.


Agreed - but only the JSP Spec. covers the use of ErrorData in error pages. So, look at both!

Servlet 2.5 Spec: SRV.9.9
JSP 2.1 Spec: JSP.1.4
 
Mark Wa
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I needed to pass it onto a pojo method. Which I did using the second EL, but changed a bit to
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!