Gregg -

Any chance you could do this in two steps?

Could you implement a filter on the url pattern /* .  If the request
uri is for something in the root, chain it through.  If it is not,
forward it to the required servlet?

Just a thought.

DJ


On 3/5/10, GreggCarrier <greggcarr...@gmail.com> wrote:
>
> I'm having a frustrating problem and I can't find the right configuration
> for
> what I want. Hoping someone can offer some insight.
>
> Desired behavior: I want all requests to my webapp to be handled by one
> servlet except requests for index.jsp or the root of the webapp. I do not
> want trailing slashes to be required in order to load URLs.
>
> The setups I have tried and the results:
>
> 1 - <servlet-mapping>
>         <servlet-name>Jersey Spring Web Application</servlet-name>
>         <url-pattern>/</url-pattern>
>     </servlet-mapping>
>
>     <welcome-file-list>
>         <welcome-file>index.jsp</welcome-file>
>     </welcome-file-list>
>
> In this case, the index.jsp loads fine at /mywebapp/. The servlet handles
> all other requests appropriately EXCEPT it requires a trailing slash at the
> end of all URLs. Eg, /mywebapp/foo/ loads but /mywebapp/foo does not. This
> setup would be perfect except for the trailing slash requirement. I want it
> to load with or without the trailing slash.
>
> 2 - <servlet-mapping>
>         <servlet-name>Jersey Spring Web Application</servlet-name>
>         <url-pattern>/*</url-pattern>
>     </servlet-mapping>
>
>     <welcome-file-list>
>         <welcome-file>index.jsp</welcome-file>
>     </welcome-file-list>
>
> With this setup the servlet handles requests with and without the trailing
> slash (correctly). The index.jsp will not load at /mywebapp/ or
> /mywebapp/index.jsp.
>
> Any ideas? Thanks very much!
>
> Gregg
> --
> View this message in context:
> http://old.nabble.com/Servlet-mapping%2C-welcome-file-and-trailing-slashes-tp27801086p27801086.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
Sent from my mobile device

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to