AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Preserving invalid URL

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
rjames1999
Guest





PostPosted: Tue Dec 28, 2004 3:56 pm    Post subject: Preserving invalid URL Reply with 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</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





PostPosted: Wed Dec 29, 2004 7:16 am    Post subject: Re: Preserving invalid URL Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.