You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Raymond P. Jones" <rj...@albany.net> on 2006/04/15 18:05:55 UTC

servlet mapping request

Hello Tomcat Users.
I need your help regarding servlet mappings in our WEB-INF/web.xml file running on an Apache webserver with a Tomcat container(most recent release) on a public website.  After putting our web.xml file in public\WEB-INF and asking our web host to restart Tomcat, our servlet mappings stilll do not work in our test web page.
I've searched through many books, even a Tomcat Quickstart book and they all say Tomcat has to be restarted for the servlet mappings in web.xml to work.  So we requested a Tomcat restart and after this, the servlet mapping we use gives a <page not found> error.  When I use /servlet/EventsServlet in <a> link, it calls the servlet and it works, but according to Tomcat documentation this is a security issue that we don't want to implement.

I'm hoping that you know what the solution(s) are and can point me in the right direction.
I'm appreciative for assist that you may provide.

Raymond P. Jones
Ph:  518-446-9845
E:  rjon@albany.net

Re: servlet mapping request

Posted by David Rush <ya...@davidarush.com>.
I've got the example invoker servlet stuff uncommented from 
conf/web.xml, and have restarted Tomcat, but am unable to get a simple 
test servlet to function.  The test servlet class file 
(SimpleServlet.class) file is under 
WEB-INF/classes/SimpleServlet.class.  A simple HTML file located in the 
web app's root works, so I know I've got the web app at least partially 
configured right and pointed in the right directory.

When I shove the URL of my test servlet 
(http://teton:8018/servlet/SimpleServlet) into my browser, I get the 
Tomcat 404 error page ("The requested resource (/servlet/SimpleServlet) 
is not available.").  Tomcat is on an unusual port in order to 
accommodate multiple instances (although only one is running right now).

I do understand that there are security issues with doing things this 
way, but I'd like to see something this simple work before I press on to 
other stuff.

What could be wrong?

David

> You are trying to use the invoker servlet. This is evil. See
> http://tomcat.apache.org/faq/misc.html#invoker If you insist on doing
> this you will need to enable the invoker servlet in conf/web.xml and
> restart Tomcat.
>
> Mark
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet mapping request

Posted by "Raymond P. Jones" <rj...@albany.net>.
Hello Tomcat Users:

The isp I use did it this way.  I see that /servlet/* is bad.  How should it
be written so that they/we will not be using the invoker?  Also, do you know
of isp's who setup httpd.conf to accomodate jsps/servlets?

> 3. Here is requested info from httpd.conf:
<snip/>

> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
> JkMount /servlets/* ajp13

You are trying to use the invoker servlet. This is evil. See
http://tomcat.apache.org/faq/misc.html#invoker If you insist on doing
this you will need to enable the invoker servlet in conf/web.xml and
restart Tomcat.

Mark

----- Original Message -----
From: "Mark Thomas" <ma...@apache.org>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, April 19, 2006 12:58 PM
Subject: Re: servlet mapping request


> Raymond P. Jones wrote:
> > Hello Mark on Tomcat Users.
> > 1. Tomcat version is 5.5.9
> >
> > 2. Content of web.xml in
> <snip/>
> >   <servlet>
> >     <servlet-name>EventsServlet</servlet-name>
> >     <servlet-class>EventsServlet</servlet-class>
> >   </servlet>
>
> Your servlets should be in packages. See the FAQ
> http://tomcat.apache.org/faq/classnotfound.html If you use the invoker
> (see below) I *think* you will be OK with packageless classes but I
> have never tried it and don't recommend it.
>
> > 3. Here is requested info from httpd.conf:
> <snip/>
>
> > JkMount /*.jsp ajp13
> > JkMount /servlet/* ajp13
> > JkMount /servlets/* ajp13
>
> You are trying to use the invoker servlet. This is evil. See
> http://tomcat.apache.org/faq/misc.html#invoker If you insist on doing
> this you will need to enable the invoker servlet in conf/web.xml and
> restart Tomcat.
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet mapping request

Posted by Mark Thomas <ma...@apache.org>.
Raymond P. Jones wrote:
> Hello Mark on Tomcat Users.
> 1. Tomcat version is 5.5.9
> 
> 2. Content of web.xml in
<snip/>
>   <servlet>
>     <servlet-name>EventsServlet</servlet-name>
>     <servlet-class>EventsServlet</servlet-class>
>   </servlet>

Your servlets should be in packages. See the FAQ
http://tomcat.apache.org/faq/classnotfound.html If you use the invoker
(see below) I *think* you will be OK with packageless classes but I
have never tried it and don't recommend it.

> 3. Here is requested info from httpd.conf:
<snip/>

> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
> JkMount /servlets/* ajp13

You are trying to use the invoker servlet. This is evil. See
http://tomcat.apache.org/faq/misc.html#invoker If you insist on doing
this you will need to enable the invoker servlet in conf/web.xml and
restart Tomcat.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet mapping request

Posted by "Raymond P. Jones" <rj...@albany.net>.
Hello Tomcat Users.
I've researched Linux books for a solution and no luck on httpd.conf.  So I
am guessing all I need to do is change the following in httpd.conf
FROM :
> LoadModule jk_module          libexec/mod_jk.so
> AddModule mod_jk.c
>
> <VirtualHost 64.235.243.224>
> ServerAlias nbfc.us
> ServerAdmin webmaster@nbfc.us
> DocumentRoot /home/nbfcus/public_html
> BytesLog domlogs/nbfc.us-bytes_log
> ServerName www.nbfc.us
> User nbfcus
> Group nbfcus
> CustomLog /usr/local/apache/domlogs/nbfc.us combined
> ScriptAlias /cgi-bin/ /home/nbfcus/public_html/cgi-bin/
> <IfModule mod_jk.c>
> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
> JkMount /servlets/* ajp13
> </IfModule>
> </VirtualHost>

TO :
> LoadModule jk_module          libexec/mod_jk.so
> AddModule mod_jk.c
>
> <VirtualHost 64.235.243.224>
> ServerAlias nbfc.us
> ServerAdmin webmaster@nbfc.us
> DocumentRoot /home/nbfcus/public_html
> BytesLog domlogs/nbfc.us-bytes_log
> ServerName www.nbfc.us
> User nbfcus
> Group nbfcus
> CustomLog /usr/local/apache/domlogs/nbfc.us combined
> ScriptAlias /cgi-bin/ /home/nbfcus/public_html/cgi-bin/
> <IfModule mod_jk.c>
> JkMount /*.jsp ajp13
> JkMount /events/* ajp13
> JkMount /servletHandler/* ajp13
> </IfModule>
> </VirtualHost>

On our host's website.  All I did was replace /servlet/ with my desired
servlet mappings.  Would this work?

----- Original Message -----
From: "Raymond P. Jones" <rj...@albany.net>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, April 18, 2006 7:05 PM
Subject: Re: servlet mapping request


> Hello Mark on Tomcat Users.
> 1. Tomcat version is 5.5.9
>
> 2. Content of web.xml in
> (public_html/WEB-INF/web.xml within 'nbfcus' homedir) :
>
> <?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>
>
>   <context-param>
>     <param-name>webmaster</param-name>
>     <param-value>rjon@albany.net</param-value>
>     <description>The EMAIL address of the administrator to whom questions
> and comments about this application should be addressed.</description>
>   </context-param>
>
>   <!-- Enable servlet mapping -->
>   <!-- To use these, you would need to call the mapped URL pattern from a
> JSP or servlet -->
>   <servlet>
>     <servlet-name>EventsServlet</servlet-name>
>     <servlet-class>EventsServlet</servlet-class>
>   </servlet>
>
>   <servlet>
>     <servlet-name>servletHandler</servlet-name>
>     <servlet-class>servletHandler</servlet-class>
>   </servlet>
>
>   <servlet-mapping>
>     <servlet-name>EventsServlet</servlet-name>
>     <url-pattern>/events</url-pattern>
>   </servlet-mapping>
>
>   <servlet-mapping>
>     <servlet-name>servletHandler</servlet-name>
>     <url-pattern>*.do</url-pattern>
>   </servlet-mapping>
>
>   <session-config>
>   <session-timeout>30</session-timeout>
>   </session-config>
>
> </web-app>
>
> 3. Here is requested info from httpd.conf:
>
> LoadModule jk_module          libexec/mod_jk.so
> AddModule mod_jk.c
>
> <VirtualHost 64.235.243.224>
> ServerAlias nbfc.us
> ServerAdmin webmaster@nbfc.us
> DocumentRoot /home/nbfcus/public_html
> BytesLog domlogs/nbfc.us-bytes_log
> ServerName www.nbfc.us
> User nbfcus
> Group nbfcus
> CustomLog /usr/local/apache/domlogs/nbfc.us combined
> ScriptAlias /cgi-bin/ /home/nbfcus/public_html/cgi-bin/
> <IfModule mod_jk.c>
> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
> JkMount /servlets/* ajp13
> </IfModule>
> </VirtualHost>
>
> I hope this can help you to help me to determine problem.
> Thx,
> Raymond P. Jones
> Ph:  518-446-9845
> E:  rjon@albany.net
>
> ----- Original Message -----
> From: "Mark Thomas" <ma...@apache.org>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Saturday, April 15, 2006 12:54 PM
> Subject: Re: servlet mapping request
>
>
> > Info we need to help you:
> >
> > 1. Exact Tomcat version. I would be extremely surprised if this really
> > is the most recent release (5.5.17)
> >
> > 2. The content of your web.xml
> >
> > 3. Given that you are using Apache as well, the relevant Jk directives
> > from your httpd.conf file
> >
> > Related to point 3, can you direct your browser to Tomcat directly,
> > bypassing Apache? If so, does this work?
> >
> > Mark
> >
> > Raymond P. Jones wrote:
> > > Hello Tomcat Users.
> > > I need your help regarding servlet mappings in our WEB-INF/web.xml
file
> running on an Apache webserver with a Tomcat container(most recent
release)
> on a public website.  After putting our web.xml file in public\WEB-INF and
> asking our web host to restart Tomcat, our servlet mappings stilll do not
> work in our test web page.
> > > I've searched through many books, even a Tomcat Quickstart book and
they
> all say Tomcat has to be restarted for the servlet mappings in web.xml to
> work.  So we requested a Tomcat restart and after this, the servlet
mapping
> we use gives a <page not found> error.  When I use /servlet/EventsServlet
in
> <a> link, it calls the servlet and it works, but according to Tomcat
> documentation this is a security issue that we don't want to implement.
> > >
> > > I'm hoping that you know what the solution(s) are and can point me in
> the right direction.
> > > I'm appreciative for assist that you may provide.
> > >
> > > Raymond P. Jones
> > > Ph:  518-446-9845
> > > E:  rjon@albany.net
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet mapping request

Posted by "Raymond P. Jones" <rj...@albany.net>.
Hello Mark on Tomcat Users.
1. Tomcat version is 5.5.9

2. Content of web.xml in
(public_html/WEB-INF/web.xml within 'nbfcus' homedir) :

<?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>

  <context-param>
    <param-name>webmaster</param-name>
    <param-value>rjon@albany.net</param-value>
    <description>The EMAIL address of the administrator to whom questions
and comments about this application should be addressed.</description>
  </context-param>

  <!-- Enable servlet mapping -->
  <!-- To use these, you would need to call the mapped URL pattern from a
JSP or servlet -->
  <servlet>
    <servlet-name>EventsServlet</servlet-name>
    <servlet-class>EventsServlet</servlet-class>
  </servlet>

  <servlet>
    <servlet-name>servletHandler</servlet-name>
    <servlet-class>servletHandler</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>EventsServlet</servlet-name>
    <url-pattern>/events</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>servletHandler</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

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

</web-app>

3. Here is requested info from httpd.conf:

LoadModule jk_module          libexec/mod_jk.so
AddModule mod_jk.c

<VirtualHost 64.235.243.224>
ServerAlias nbfc.us
ServerAdmin webmaster@nbfc.us
DocumentRoot /home/nbfcus/public_html
BytesLog domlogs/nbfc.us-bytes_log
ServerName www.nbfc.us
User nbfcus
Group nbfcus
CustomLog /usr/local/apache/domlogs/nbfc.us combined
ScriptAlias /cgi-bin/ /home/nbfcus/public_html/cgi-bin/
<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
</IfModule>
</VirtualHost>

I hope this can help you to help me to determine problem.
Thx,
Raymond P. Jones
Ph:  518-446-9845
E:  rjon@albany.net

----- Original Message -----
From: "Mark Thomas" <ma...@apache.org>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Saturday, April 15, 2006 12:54 PM
Subject: Re: servlet mapping request


> Info we need to help you:
>
> 1. Exact Tomcat version. I would be extremely surprised if this really
> is the most recent release (5.5.17)
>
> 2. The content of your web.xml
>
> 3. Given that you are using Apache as well, the relevant Jk directives
> from your httpd.conf file
>
> Related to point 3, can you direct your browser to Tomcat directly,
> bypassing Apache? If so, does this work?
>
> Mark
>
> Raymond P. Jones wrote:
> > Hello Tomcat Users.
> > I need your help regarding servlet mappings in our WEB-INF/web.xml file
running on an Apache webserver with a Tomcat container(most recent release)
on a public website.  After putting our web.xml file in public\WEB-INF and
asking our web host to restart Tomcat, our servlet mappings stilll do not
work in our test web page.
> > I've searched through many books, even a Tomcat Quickstart book and they
all say Tomcat has to be restarted for the servlet mappings in web.xml to
work.  So we requested a Tomcat restart and after this, the servlet mapping
we use gives a <page not found> error.  When I use /servlet/EventsServlet in
<a> link, it calls the servlet and it works, but according to Tomcat
documentation this is a security issue that we don't want to implement.
> >
> > I'm hoping that you know what the solution(s) are and can point me in
the right direction.
> > I'm appreciative for assist that you may provide.
> >
> > Raymond P. Jones
> > Ph:  518-446-9845
> > E:  rjon@albany.net
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet mapping request

Posted by Mark Thomas <ma...@apache.org>.
Info we need to help you:

1. Exact Tomcat version. I would be extremely surprised if this really
is the most recent release (5.5.17)

2. The content of your web.xml

3. Given that you are using Apache as well, the relevant Jk directives
from your httpd.conf file

Related to point 3, can you direct your browser to Tomcat directly,
bypassing Apache? If so, does this work?

Mark

Raymond P. Jones wrote:
> Hello Tomcat Users.
> I need your help regarding servlet mappings in our WEB-INF/web.xml file running on an Apache webserver with a Tomcat container(most recent release) on a public website.  After putting our web.xml file in public\WEB-INF and asking our web host to restart Tomcat, our servlet mappings stilll do not work in our test web page.
> I've searched through many books, even a Tomcat Quickstart book and they all say Tomcat has to be restarted for the servlet mappings in web.xml to work.  So we requested a Tomcat restart and after this, the servlet mapping we use gives a <page not found> error.  When I use /servlet/EventsServlet in <a> link, it calls the servlet and it works, but according to Tomcat documentation this is a security issue that we don't want to implement.
> 
> I'm hoping that you know what the solution(s) are and can point me in the right direction.
> I'm appreciative for assist that you may provide.
> 
> Raymond P. Jones
> Ph:  518-446-9845
> E:  rjon@albany.net



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet mapping request

Posted by ma...@aim.com.
Could you post your web.xml here?
Also, mention the directory structure of WEB-INF/classes and application root.
 
 
--
Manivannan Palanichamy
http://geocities.com/manivannan57



 
 
 
-----Original Message-----
From: Raymond P. Jones <rj...@albany.net>
To: users@tomcat.apache.org
Sent: Sat, 15 Apr 2006 12:05:55 -0400
Subject: servlet mapping request


Hello Tomcat Users.
I need your help regarding servlet mappings in our WEB-INF/web.xml file running 
on an Apache webserver with a Tomcat container(most recent release) on a public 
website.  After putting our web.xml file in public\WEB-INF and asking our web 
host to restart Tomcat, our servlet mappings stilll do not work in our test web 
page.
I've searched through many books, even a Tomcat Quickstart book and they all say 
Tomcat has to be restarted for the servlet mappings in web.xml to work.  So we 
requested a Tomcat restart and after this, the servlet mapping we use gives a 
<page not found> error.  When I use /servlet/EventsServlet in <a> link, it calls 
the servlet and it works, but according to Tomcat documentation this is a 
security issue that we don't want to implement.

I'm hoping that you know what the solution(s) are and can point me in the right 
direction.
I'm appreciative for assist that you may provide.

Raymond P. Jones
Ph:  518-446-9845
E:  rjon@albany.net
________________________________________________________________________
Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.