• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Invalid Path error

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
We noticed he had no friends. So we gave him this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic