The url-pattern tag in web.xml file is context-path relative.
The relevant context-paths is already defined in server.xml and every http
request have to include this in their url for the request to be passed to
tomcat.

Hence, you have to include the predefined the context path in the request,
as you've mentioned.



On Tue May 08 09:50:53 2001 MYT,
=?iso-8859-1?q?Jos=E9=20Vicente=20N=FA=F1ez=20Zuleta?=
<[EMAIL PROTECTED]> wrote:
> Greetings
> 
> I apologize if this question has been answered
> properly in other place but i'm unable to fix this
> problem :(
> 
> 
> I'm trying to mapp a Servlet to the following url:
> 
> http://localhost/HolaMundo
> 
> And i added the following to the WEB_INF/web.xml file:
> 
> <web-app>
>   <display-name>Hola Mundo</display-name>
>   <session-timeout>30</session-timeout>
>   <servlet>
>     <servlet-name>HolaMundo</servlet-name>
>    
> <servlet-class>org.eslared.taller2.HolaMundo</servlet-class>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>HolaMundo</servlet-name>
>     <url-pattern>/HolaMundo</url-pattern>
>   </servlet-mapping>
> </web-app>
> 
> I'm also using the automatic generated configuration
> file on apache (i'm including the file at the end of
> the httpd.conf file):
> 
> 
> #<VirtualHost *>
> #    ServerAdmin [EMAIL PROTECTED]
> #    DocumentRoot /www/docs/dummy-host.example.com
> #    ServerName dummy-host.example.com
> #    ErrorLog logs/dummy-host.example.com-error_log
> #    CustomLog logs/dummy-host.example.com-access_log
> common
> #</VirtualHost>
> 
> Include
> /local/jakarta/dist/tomcat/conf/mod_jk.conf-auto
> 
> This is the directory layout:
> 
> [root@jose webapps]# find ./holamundo -print
> ../holamundo
> ../holamundo/META-INF
> ../holamundo/META-INF/MANIFEST.MF
> ../holamundo/WEB-INF
> ../holamundo/WEB-INF/classes
> ../holamundo/WEB-INF/classes/org
> ../holamundo/WEB-INF/classes/org/eslared
> ../holamundo/WEB-INF/classes/org/eslared/taller2
> ../holamundo/WEB-INF/classes/org/eslared/taller2/HolaMundo.class
> ../holamundo/WEB-INF/lib
> ../holamundo/WEB-INF/web.xml
> ../holamundo/holamundo.jsp
> 
> 
> I got errors calling the following url's:
> http://localhost/HolaMundo (this the desired url)
> http://localhost:8080/HolaMundo
> http://localhost/holamundo/HolaMundo 
> 
> But the following ones work perfectly (but without the
> desired effect):
> 
> http://localhost/holamundo/servlet/HolaMundo
> http://localhost:8080/holamundo/HolaMundo
> 
> 
> I checked the following resources witthout any
> results:
> 
> http://mikal.org/interests/java/tomcat/archive/view?mesg=27294
> 
> 
> Any ideas what i'm doing wrong?
> 
> 
> 
> Thanks in advance.
> 
> =====
> Jos Vicente Nez Zuleta
> System Engineer / Developer
> Development Leader, Diario El Universal
> http://www.eluniversal.com
> http://www.autofuturo.com (current project)
> 
> _________________________________________________________
> Do You Yahoo!?
> Obtenga su direccin de correo-e gratis @yahoo.com
> en http://correo.espanol.yahoo.com
> 

Reply via email to