 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
rjames1999 Guest
|
Posted: Tue Dec 28, 2004 3:56 pm Post subject: Preserving invalid URL |
|
|
Hello All,
I am working on a java web application and have the need to preserve a
URL that throws a 404 error. I have the following entered into my
web.xml:
<error-page>
<error-code>404</error-code>
<location>/servlet/RequestParameterAction</location>
</error-page>
This works fine. In the servlet I forward on to an appropriate page
after some processing. What I am trying to do now is capture the
incorrect URL. However, when I get the request URI/URL all I get is
the servlet address, for example:
/mycontext/servlet/RequestParameterAction
Is there a way to programmatically trap the URL that threw the 404
error? I'd prefer to not have to go and tweak the webserver settings.
I'm running this application under JRun 3.1, although I've tested it
under 4.0 and get the same results.
Thanks!
R
|
|
| Back to top |
|
 |
Josh Martin Guest
|
Posted: Wed Dec 29, 2004 7:16 am Post subject: Re: Preserving invalid URL |
|
|
Have you tried a filter (javax.servlet.Filter)? I imagine you could check
the response code on the way out to see if it's a 404.
"rjames1999" <rjames1999 (AT) gmail (DOT) com> wrote
| Quote: | Hello All,
I am working on a java web application and have the need to preserve a
URL that throws a 404 error. I have the following entered into my
web.xml:
error-page
error-code>404</error-code
location>/servlet/RequestParameterAction
/error-page
This works fine. In the servlet I forward on to an appropriate page
after some processing. What I am trying to do now is capture the
incorrect URL. However, when I get the request URI/URL all I get is
the servlet address, for example:
/mycontext/servlet/RequestParameterAction
Is there a way to programmatically trap the URL that threw the 404
error? I'd prefer to not have to go and tweak the webserver settings.
I'm running this application under JRun 3.1, although I've tested it
under 4.0 and get the same results.
Thanks!
R
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|