Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

servlet mapping similarity/overlap ?

Jules Yasuna

2003-10-15


Here is a snippet from web.xml ...

<!-- define a servlet -->
<servlet>
  <servlet-name>Controller</servlet-name>
  <servlet-class>com.xxx.Controller</servlet-class>
</servlet>

<!-- map the servlet twice -->
<servlet-mapping>
  <servlet-name>Controller</servlet-name>
  <url-pattern>/test</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>Controller</servlet-name>
  <url-pattern>/test/</url-pattern>
</servlet-mapping>


please notice the two servlet mappings, one to "/test" and the other
to "/test/"

the only difference is the trailing slash, but I wish to have both
uri's mapped to the same servlet

must i add both <servlet-mapping> elements, or is there a better way to do
this?


thanks in advance ... jules

----------------------------
Jules Yasuna
Bookus-Boulet. Inc.
http://www.bookus-boulet.com
(508) 523-7663
----------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.