tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: url-pattern question
Date Sat, 24 Feb 2001 21:12:07 GMT
Karl Martino wrote:

> In a web application I have a top level servlet
> url-mapped to the web application's root.
> For example, my web application, called content, has a
> url-mapping of /* .  This is a controller servlet in a
> MVC type application.

In Struts, <>, the recommended approach
is to map the controller to a filename extension pattern, instead of
mapping everything like this.  I prefer the "*.do" extension, because it
implies "go do something" when you submit a form to "/".

The advantage of this approach is that the normal mapping of "*.jsp" to
the JSP page compiler still works.  The disadvantage is that users can
bypass your controller and address a JSP page directly.  You cannot do
much about this in a servlet 2.2 environment, but in a 2.3 environment
(like Tomcat 4.0) we'll be able to use the new Filter APIs to do things
like enforce logged-on status.

Craig McClanahan

View raw message