tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhaval Sheth" <doubles...@yahoo.com>
Subject wild cards in web.xml
Date Thu, 27 Sep 2001 22:43:30 GMT
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


Mime
View raw message