PlanetJava
Custom Search

java-stripes-user
[Top] [All Lists]

Re: clean urls without /action/*

Subject: Re: clean urls without /action/*
Date: Thu, 7 Feb 2008 08:00:48 +0100
On 06-02-2008 at 20:40, Ben Gunter wrote:
> This isn't really about Stripes. It's about servlets. If you don't provide 
> a prefix (e.g., /action/*), a suffix (e.g., *.action), or an exact mapping 
> (e.g., /some/servlet) then the servlet container can't map the URL to a 
> servlet. Stripes' clean URLs absolutely will handle URLs that don't share a 
> common prefix or suffix, but if you choose to do it that way then you 
> somehow must tell the servlet container what prefixes are mapped where. You 
> can do that by either mapping them all in web.xml (painful) or using a 
> filter to do it automatically. This is reflected in the prominent note at 
> the top of the Struts filter javadoc: "*IMPORTANT*: this filter must be 
> mapped to all requests. Unless you know exactly what you are doing, always 
> map to this URL pattern: /*"
Maybe one can test the existence of a file with the exact URL path in a
servlet/filter? I'm thinking of something like this:
- the request enters the servlet/filter
- it checks if it can be a request for a file
- if so, it serves the file
- if not, the request is handled as it is now
Advantage of this would be that restful URL's are possible
Disadvantages include:
- slightly(?) lower performance
- it's no longer possible to use separate frameworks with such restful
  URL's (although it's still possible to map other servlets/filters by
  prefix, postfix, etc.)
Just my 2 cents.
Oscar
-- 
   ,-_   No man has a natural right to commit aggression on the equal
  /() )  rights of another, and this is all from which the laws ought to
 (__ (   restrain him.
=/  ()    -- Thomas Jefferson
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy