Where can I find the correct order for web.xml. I am going through the DTD
but it does not mention any preferred order. I tried moving my error-page
directive inside web.xml, but that did not help ??

My web.xml (this is the web.xml shipped in tomcat/conf) has following
entries in this order

<web-app>
  <servlet>
    <servlet-name>default</servlet-name>
 
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>listings</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
 
  :
  :
  : 
  
  other similar servlet entries

  :
  :  
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  
  :
  :
  :
   other servlet mappings

  :
  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>

  :
  <mime-mapping>
    <extension>abs</extension> 
    <mime-type>audio/x-mpeg</mime-type>
  </mime-mapping>

  :
  :
  :
   other mime-mappings   

  :
  :
  
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>  
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

</web-app>


Where do you think I should put the error-page directive in here??

Thanks

Animesh



   

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 11:15 AM
To: Tomcat Users List
Subject: Re: web.xml parse error



You probably have the web.xml defined in an incorrect order. To answer your
other question, you could define a 403 (forbidden) error page. Note this
may only work right when using form-based authentication. With Basic
authentication, you might need to override the Authenticator class that
does the Basic authentication. As for 500 Internal Server error, many users
have faced problems in defining an error page. But you could try doing the
same thing as you have done for a 404 error-page declaration. Or you could
probably define an error page directive for Servlet Exception.

RS





Animesh Chaturvedi - US <[EMAIL PROTECTED]> on 04/23/2002
01:03:57 PM

Please respond to "Tomcat Users List" <[EMAIL PROTECTED]>

To:    'Tomcat Users List' <[EMAIL PROTECTED]>
cc:

Subject:    web.xml parse error

Hi

I am adding the following error-page directive to web.xml.

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

I always get the following error on starting tomcat

Apache Tomcat/4.0.3
PARSE error at line 866 column 11
org.xml.sax.SAXParseException: The content of element type "web-app" must
match
"(icon?,display-name?,description?,distributable?,context-param*,filter*,fil

ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin

g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se

curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca

l-ref*)".

I tried putting the error-page directive in tomcat/conf/web.xml and then in
my application context web.xml. But nothing works.

One more question I don't like to see Tomcat's 500 Internal Server error
page or 403 page. I want my customized page to show up. How can I do that?



Thanks

Animesh

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>










--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to