| Josh Martin 2004-12-29, 3:58 am |
| 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@gmail.com> wrote in message
news:1104249365.152281.51930@f14g2000cwb.googlegroups.com...
> 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
>
|