tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marzio De Biasi <vorxio2...@yahoo.com>
Subject Part II: web.xml: troubles with wildchar in <servlet-mapping> element
Date Wed, 27 Sep 2000 18:02:15 GMT
Perhaps, I've missed some information in the previoud email:

*** I WANT TO REDIRECT ALL REQUESTS TO http://www.xyz.it/myapp/<anyfile 
with .zzz extension>
(e.g. http://www.xyz.it/myapp/afile.zzz, 
http://www.xyz.it/myapp/anotherfile.zzz, etc.)
TO ONE SERVLET hiservlet

In tomcat.conf (included in apache's httpd.conf) I've inserted:
...
ApJServMount /myapp ajpv12://localhost:8007/myapp
<Directory "/opt/tomcat/webapps/myapp">
     Options Indexes FollowSymLinks
     Order Allow,Deny
     Allow from All
</Directory>

*** I Think (and perhaps I'm wrong???) that this should be enough to pass 
EVERYTHING that start with /myapp from Apache to Tomcat

Then I've configured the web.xml file in /myapp/WEB-INF directory in this 
manner:
...
<web-app>
     <servlet>
         <servlet-name>
             zzz
         </servlet-name>
         <servlet-class>
             hiservlet
         </servlet-class>
     </servlet>
     <servlet-mapping>
         <servlet-name>
             zzz
         </servlet-name>
         <url-pattern>
             *.zzz
         </url-pattern>
     </servlet-mapping>
</web-app>

*** I think (and perhaps I'm wrong???) that this should be enough to 
redirect all tomcat requests of files with .zzz extension in /webapp 
directory to servlet hiservlet.

When using port 8080 (tomcat http) everything seems to be ok:

http://www.xyz.it:8080/myapp/hiservlet --> OK
http://www.xyz.it:8080/myapp/zzz       --> OK
http://www.xyz.it:8080/myapp/dum.zzz   --> OK
http://www.xyz.it:8080/myapp/alpha.zzz --> OK

When I access the servlet via apache the last two don't work (I get "Error: 
404  Location: /myapp/dum.zzz"):

http://www.xyz.it/myapp/hiservlet      --> OK
http://www.xyz.it/myapp/zzz            --> OK
http://www.xyz.it/myapp/dum.zzz        --> KO ???
http://www.xyz.it/myapp/alpha.zzz      --> KO ???

Adding the following lines to tomcat.conf:
...
AddType text/zzz .zzz
AddHandler jserv-servlet .zzz
...
*** would solve the problem, but in this case apache would redirect EVERY 
file with .zzz extension to TOMCAT (and I only want to redirect files in 
/myapp directory)

***Excuse me for the previous incomplete email.
***Can you help me?
***Thank you in advance.

Marzio De Biasi (***please reply to: vorxio2000@yahoo.com)

P.S. another final question: how can I subscribe to mailing list tomcat-user?
I've sent a mail to tomcat-user-subscribe@jakarta.apache.org with Subject: 
SUBSCRIBE, but it happened  nothing


Mime
View raw message