You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dhaval Sheth <do...@yahoo.com> on 2001/09/28 00:43:30 UTC
wild cards in web.xml
Hi
For each and every servlet in our web application, we are adding entries to
web.xml.
I was wondering if its possible to either use wildcards or any other
keywords or tag so
that we do not have to update web.xml everytime we add a new servlet.
For ex - to access login servlet we give the URI as
https://domainname/webapp/servlet/login
and login servlet is mapped to its complete package in the web.xml file
as shown.
<servlet>
<servlet-name>
login
</servlet-name>
<servlet-class>
com.companyname.security.login
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
login
</servlet-name>
<url-pattern>
com/companyname/security/login
</url-pattern>
</servlet-mapping>
So is it possible to use like a * (or a keyword if its there) so that
web.xml looks
<servlet>
<servlet-name>
*
</servlet-name>
<servlet-class>
com.companyname.security
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
*
</servlet-name>
<url-pattern>
com/companyname/security
</url-pattern>
</servlet-mapping>
So for any servlet like login, logout .... it should get mapped to
com.companyname.security....
Thanks
Dhaval Sheth
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com