This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Invalid Path error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Invalid Path error" Watch "Invalid Path error" New topic
Author

Invalid Path error

Gezza Hall
Ranch Hand

Joined: Jan 04, 2005
Posts: 33
Hi all.

I have a problem where if someone enters an invalid url into the browser, then the server returns 'Invalid Path error'. For example, if a .do call is bookmarked, that is not actually a valid page to request.

Is there a way of specifying a catch-all page which is automatically forwarded to when nothing is found? The exception/error page doesn't come into affect here as there isn't actually any exception thrown.

Thanks for any advice!
Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Hi,
I think you can define that at web deployment descriptor (web.xml).
That is at error-page element
So when the container receive an HTTP error then it will redirect to an error page which you define at web.xml.

Correct me if I am wrong...

thanks
daniel
Gezza Hall
Ranch Hand

Joined: Jan 04, 2005
Posts: 33
You mean something like this?

<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>

The problem is how do I specify an error code if one isn't thrown?
 
Consider Paul's rocket mass heater.
 
subject: Invalid Path error
 
Similar Threads
"Exception processing JAR at resource path" error.
addActionError in struts2
JSF : redirect errors to error page
One issue in popup/setfocus that I would like to get clarified..
Query reg JSP session