tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben short" <...@benshort.co.uk>
Subject Re: Tomcat 5.5 Regular Expression as servlet-mapping url-pattern
Date Fri, 27 Oct 2006 20:42:18 GMT
Hi,

I got it working but changed to to the following..

<web-app>
  <display-name>Archetype Created Web Application</display-name>

    <servlet>
        <servlet-name>test</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

   <servlet-mapping>
       <servlet-name>default</servlet-name>
       <url-pattern>/images</url-pattern>
   </servlet-mapping>

   <servlet-mapping>
       <servlet-name>default</servlet-name>
       <url-pattern>/css</url-pattern>
   </servlet-mapping>

   <servlet-mapping>
       <servlet-name>default</servlet-name>
       <url-pattern>/js</url-pattern>
   </servlet-mapping>

    <servlet-mapping>
       <servlet-name>test</servlet-name>
       <url-pattern>/</url-pattern>
   </servlet-mapping>

</web-app>

The default servlet is defined in the conf/web.xml file.

Many thanks for you help.

Ben

On 10/27/06, Caldarale, Charles R <Chuck.Caldarale@unisys.com> wrote:
> > From: jamin.short@gmail.com [mailto:jamin.short@gmail.com]
> > Subject: Re: Tomcat 5.5 Regular Expression as servlet-mapping
> > url-pattern
> >
> > Do you have an example of this?
>
> Add this to your app's web.xml:
>
>     <servlet>
>         <servlet-name>tcdefault</servlet-name>
>
> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-clas
> s>
>         <load-on-startup>1</load-on-startup>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>tcdefault</servlet-name>
>         <url-pattern>/images</url-pattern>
>     </servlet-mapping>
>
>     <servlet-mapping>
>         <servlet-name>tcdefault</servlet-name>
>         <url-pattern>*.css</url-pattern>
>     </servlet-mapping>
>
>     <servlet-mapping>
>         <servlet-name>tcdefault</servlet-name>
>         <url-pattern>*.js</url-pattern>
>     </servlet-mapping>
>
> Extend as needed.  Not tested, but should work, barring typos.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message