Hi there,

I've set up a basic web.xml file to test that my ssl connection is working fine 
for the specified pages to be protected in this way and to test to see if my 
custom 404 error page works fine.

I've got the certificate for my SSL page working fine and I've tested it 
before, but since I've customised the web.xml file I just keep getting the 
generic error page.  I don't even get the error page I've set in my web.xml 
file.

I'm using Tomcat 5.5.15 and jdk 1.5.0_05 so it's all the latest installations.  
My web.xml fille and the relevant part from my server.xml file are attached.  
If anyone can tell me why the error-page and security-constraint tags aren't 
working I'd be very grateful.

Many thanks

Mark Whitby


Web.xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC 
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app>

<!--
Specifies the first page that users will come to in the system
-->
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

<!--
Specifies the error page that will occur for 404 errors
-->

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


<!--
Specifies the security area within the system
-->

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Secure</web-resource-name>
      <url-pattern>/secure/*</url-pattern>
    </web-resource-collection>
    <user-data-contraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    <user-data-contraint>
  </security-constraint>


</web-app>

server.xml file

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
port="8080"               maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
     to 0 -->

    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
    
    <Connector port="8443" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" 
keystoreFile="D:\FYPCode\keystore" keystorePass="......." />

Reply via email to