...
| Code Block | ||
|---|---|---|
| ||
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.handler.ContextHandler">
<Call class="org.mortbay.log.Log" name="debug"><Arg>Configure javadoc.xml</Arg></Call>
<Set name="contextPath">/javadoc</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/javadoc/</Set>
<!-- Instantiate your own error handler -->
<Set name="errorHandler">
<New class="com.acme.handler.MyErrorHandler"/>
</Set>
</Configure>
|
4. Server level 404 error
One may get a 'page not found' when a request is made to the server for a resource that is outside of any registered contexts. As an example, you have a domain name pointing to your public server IP yet no context is registered with jetty to serve pages for that domain. As a consequence, the server, by default, will give a listing of all context running on the server.
One of the quickest ways to avoid this behavior is to create a catch all context. Create a "root" web app mapped to the "/" url. Have the index.html redirect to whatever place with a header directive.