You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Connie Chan <cc...@drfirst.com> on 2001/05/02 00:38:05 UTC

Need help on servlet-mapping

Hi,

My application is running on Apache with Tomcat 3.2.1.  I want to set
servlet mapping for HTTPS protocol.  When a user specifies
https://myhost.com/io/GetFile/hello.xls, the servlet
myapps.FileSearchServlet gets invoked and handle the request.  What I
did is to specify the servlet mapping in the web.xml (which located
under myapps\Web-inf) and specify "JkMount /io/* ajp12" in httpd.conf
for apache server.  The https is set up as a virtual host using port 443
and ssl module supported by apache.  When I test the program, it looks
like that the apache redirects the request to tomcat.  But the tomcat
displays an error that the file is not found.

I tried the web.xml in another computer running tomcat only without
https (i.e. http://myhost.com/io/GetFile/hello.xls).  It works.  Tomcat
can recognized the url pattern and invoke the servlet.  Does anyone know
if the web.xml is recognized by the virtual host?  Or, I did something
wrong?  And does anyone know how to fix it?  


Here is the portion of the web.xml:

    <servlet>
        <servlet-name>
            getfile
        </servlet-name>
        <servlet-class>
            myapps.FileSearchServlet
        </servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>
            getfile
        </servlet-name>
        <url-pattern>
            /io/GetFile/*
        </url-pattern>
    </servlet-mapping>  

Thanks,
Connie

Re: Need help on servlet-mapping

Posted by Milt Epstein <me...@uiuc.edu>.
On Tue, 1 May 2001, Connie Chan wrote:

> Hi,
>
> My application is running on Apache with Tomcat 3.2.1.  I want to set
> servlet mapping for HTTPS protocol.  When a user specifies
> https://myhost.com/io/GetFile/hello.xls, the servlet
> myapps.FileSearchServlet gets invoked and handle the request.  What I
> did is to specify the servlet mapping in the web.xml (which located
> under myapps\Web-inf) and specify "JkMount /io/* ajp12" in httpd.conf
> for apache server.  The https is set up as a virtual host using port 443
> and ssl module supported by apache.  When I test the program, it looks
> like that the apache redirects the request to tomcat.  But the tomcat
> displays an error that the file is not found.
>
> I tried the web.xml in another computer running tomcat only without
> https (i.e. http://myhost.com/io/GetFile/hello.xls).  It works.  Tomcat
> can recognized the url pattern and invoke the servlet.  Does anyone know
> if the web.xml is recognized by the virtual host?  Or, I did something
> wrong?  And does anyone know how to fix it?
[ ... ]

I would think at this point, the problem would be either with the
directives you have in the tomcat/apache conf file, or in tomcat's
server.xml, not in the app's web.xml.  Apparently something is
different between the config for the http side of things and the https
side.

For example, which directives are in the default section of the
tomcat/apache conf file, and which directives are in the https virtual
host section?  But if the URL is getting passed from apache to tomcat,
it would seem that stuff is working OK.

What is the error that tomcat is showing?  That might provide some
clues as to the problem.

(These are meant to be suggestions for things for you to look at as
opposed to posting the info here.)

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu