palAlaa
palAlaa

Reputation: 9878

Handle a non existing servlet exception

When I type a non-existing servlet in a url an exception error

HTTP Status 404 - 

that's reasonable, but where should I handle the exception? at what scope??

Upvotes: 0

Views: 133

Answers (1)

Jeremy
Jeremy

Reputation: 22435

You can automatically deliver a custom 404 page. In your web.xml put something like:

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

Upvotes: 5

Related Questions