You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Feng Xia <FX...@netpcs.com> on 2001/07/11 16:36:56 UTC
mapping question
Hi there,
I am trying to make servlet mapping working for my apache+tomcat on
Solaris 8. I need to map some time /myfile.html to a servlet
com.corp.servlet.LightWeightUiServlet. I add the following tags to
$TOMCAT_HOME/conf/web.xml.
<servlet>
<servlet-name>
myservlet
</servlet-name>
<description>
</description>
<servlet-class>
com.corp.servlet.LightWeightUiServlet
</servlet-class>
<!-- Load this servlet at server startup time -->
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>
myservlet
</servlet-name>
<url-pattern>
/myfile.html
</url-pattern>
</servlet-mapping>
All my class files are installed under $TOMCAT_HOME/classes and
$TOMCAT_HOME/lib
It did not for me. I got the 404 error. The request is logged as an
error in apache and is never dispatched to servlet. Then I addes a line
in mod_jk.conf-auto
JkMount /myfile.html ajp12
and restart apache. This time the request was send to servlet but got a
error "Ctx( ): 404 R( + /myfile.html + null) null"
I have no clue what to do next. Would somebody give me some advice?
Thanks,
Feng
Re: mapping question
Posted by Feng Xia <fx...@netpcs.com>.
It is still not working for me. Would you copy and paste what is in your
server.xml and web.xml? And what is URL to access the class?
Thanks,
Feng
Andreas Tirok wrote:
> Hi,
>
> Feng Xia wrote at Wednesday 11 July 2001 16:38:
> > My apache is 1.3.14. My tomcat is 3.2.2.
> >
> > Feng Xia wrote:
> > > Hi there,
> > >
> > > I am trying to make servlet mapping working for my apache+tomcat on
> > > Solaris 8. I need to map some time /myfile.html to a servlet
> > > com.corp.servlet.LightWeightUiServlet. I add the following tags to
> > > $TOMCAT_HOME/conf/web.xml.
> > > <servlet>
> > > <servlet-name>
> > > myservlet
> > > </servlet-name>
> > > <description>
> > > </description>
> > > <servlet-class>
> > > com.corp.servlet.LightWeightUiServlet
> > > </servlet-class>
> > > <!-- Load this servlet at server startup time -->
> > > <load-on-startup>5</load-on-startup>
> > > </servlet>
> > > <servlet-mapping>
> > > <servlet-name>
> > > myservlet
> > > </servlet-name>
> > > <url-pattern>
> > > /myfile.html
> > > </url-pattern>
> > > </servlet-mapping>
> This looks ok.
>
> > >
> > > All my class files are installed under $TOMCAT_HOME/classes and
> > > $TOMCAT_HOME/lib
> I tried the same thing some days ago.
> I found, that you must have at least following directory
> structure in $TOMCAT_HOME/webapps :
>
> myapp // application root dir
> |
> +----- WEB-INF // contains web.xml !
> +
> |
> + classes // contains your servlets
>
> Restart tomcat and let me know what will happen.
>
> andy
> --
> -------------------------------
> mailto:Andreas.Tirok@beusen.de
> fon: +49 30 549932-37
> fax: +49 30 549932-21
Re: mapping question
Posted by Andreas Tirok <An...@beusen.de>.
Hi,
Feng Xia wrote at Wednesday 11 July 2001 16:38:
> My apache is 1.3.14. My tomcat is 3.2.2.
>
> Feng Xia wrote:
> > Hi there,
> >
> > I am trying to make servlet mapping working for my apache+tomcat on
> > Solaris 8. I need to map some time /myfile.html to a servlet
> > com.corp.servlet.LightWeightUiServlet. I add the following tags to
> > $TOMCAT_HOME/conf/web.xml.
> > <servlet>
> > <servlet-name>
> > myservlet
> > </servlet-name>
> > <description>
> > </description>
> > <servlet-class>
> > com.corp.servlet.LightWeightUiServlet
> > </servlet-class>
> > <!-- Load this servlet at server startup time -->
> > <load-on-startup>5</load-on-startup>
> > </servlet>
> > <servlet-mapping>
> > <servlet-name>
> > myservlet
> > </servlet-name>
> > <url-pattern>
> > /myfile.html
> > </url-pattern>
> > </servlet-mapping>
This looks ok.
> >
> > All my class files are installed under $TOMCAT_HOME/classes and
> > $TOMCAT_HOME/lib
I tried the same thing some days ago.
I found, that you must have at least following directory
structure in $TOMCAT_HOME/webapps :
myapp // application root dir
|
+----- WEB-INF // contains web.xml !
+
|
+ classes // contains your servlets
Restart tomcat and let me know what will happen.
andy
--
-------------------------------
mailto:Andreas.Tirok@beusen.de
fon: +49 30 549932-37
fax: +49 30 549932-21
Re: mapping question
Posted by Feng Xia <FX...@netpcs.com>.
My apache is 1.3.14. My tomcat is 3.2.2.
Feng Xia wrote:
> Hi there,
>
> I am trying to make servlet mapping working for my apache+tomcat on
> Solaris 8. I need to map some time /myfile.html to a servlet
> com.corp.servlet.LightWeightUiServlet. I add the following tags to
> $TOMCAT_HOME/conf/web.xml.
> <servlet>
> <servlet-name>
> myservlet
> </servlet-name>
> <description>
> </description>
> <servlet-class>
> com.corp.servlet.LightWeightUiServlet
> </servlet-class>
> <!-- Load this servlet at server startup time -->
> <load-on-startup>5</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>
> myservlet
> </servlet-name>
> <url-pattern>
> /myfile.html
> </url-pattern>
> </servlet-mapping>
>
> All my class files are installed under $TOMCAT_HOME/classes and
> $TOMCAT_HOME/lib
>
> It did not for me. I got the 404 error. The request is logged as an
> error in apache and is never dispatched to servlet. Then I addes a line
> in mod_jk.conf-auto
>
> JkMount /myfile.html ajp12
>
> and restart apache. This time the request was send to servlet but got a
> error "Ctx( ): 404 R( + /myfile.html + null) null"
>
> I have no clue what to do next. Would somebody give me some advice?
>
> Thanks,
> Feng