passing RequestPath to error page from web.xml

R

Rooney

Hi,

I have pointed any errors to Error.jsp in my web.xml file (as shown).

<error-page>

<error-code>500</error-code>

<location>/Error.jsp?id=500</location>

</error-page>

As you can see I also pass the type of error, is there any way I can
pass the RequestPath that resulted in the error in the first place?


Cheers,
Paul
 
J

Juha Laiho

Rooney said:
I have pointed any errors to Error.jsp in my web.xml file (as shown).

<error-page>
<error-code>500</error-code>
<location>/Error.jsp?id=500</location>
</error-page>

Please don't pass the error id by hand; the servlet container will
already do that for you.
As you can see I also pass the type of error, is there any way I can
pass the RequestPath that resulted in the error in the first place?

For this, as well as the other issue, please see SRV.9.9 in Java Servlet
Specification; the chapter describes what the container will provide
for error handling.

The specification can be found here:
http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html

The specification is good read for anyone working with Java web apps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top