For Programmers: Free Programming Magazines  


Home > Archive > Java Help > December 2004 > Re: Preserving invalid URL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Preserving invalid URL
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
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com