Hi,
Because this processing servlet of yours itself had an error.  A JSP
file by default is processed by Tomcat's JSP servlet, not your Router
servlet.  Accordingly, it's not subject to your custom error handling
mechanism.  A more standard way to do this is declare an <error-page>
for 404's in your web.xml, and/or an errorPage for the specific JSP page
in the JSP page itself.

Sorry, not sure I understand this. Is this not what I've done with this?:

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

My understanding of how this works is that any URL that ends with the string '.ext' will be picked up by my Servlet. Any other URL ('.jpg', '.jsp' or whatever) will thus fall through this, and my Router servlet will not see it. It keeps falling to the error-page code above.

Have you any sample code you would be kiind enough to paste? I'm obviously being thick here. :(

Joe.



Yoav Shapira http://www.yoavshapira.com


>Here is my web.xml file:
>
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application
>2.3//EN
>" "http://java.sun.com/dtd/web-app_2_3.dtd";>
><web-app>
>        <display-name>My server</display-name>
>
>        <servlet><servlet-name>Router</servlet-name>
>                <servlet-class>com.mycompany.Router</servlet-class>
>        </servlet>
>        <servlet><servlet-name>InitServlet</servlet-name>
>
<servlet-class>com.mycompany.InitServlet</servlet-class>
>                <load-on-startup>2</load-on-startup>
>        </servlet>
>
>        <servlet-mapping><servlet-name>InitServlet</servlet-name>
>                        <url-pattern>/InitServlet</url-pattern>
>        </servlet-mapping>
>        <!-- All URLs end .ext. These are processed by the front
>controller.
>-->
>        <servlet-mapping><servlet-name>Router</servlet-name>
>                        <url-pattern>*.ext</url-pattern>
>        </servlet-mapping>
>
>
><session-config><session-timeout>30</session-timeout></session-config>
>
>        <welcome-file-list><welcome-file>index.html</welcome-file>
>        </welcome-file-list>
>        <error-page><error-code>404</error-code>
>                <location>/404.html</location>
>        </error-page>
></web-app>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to