PlanetJava
Custom Search

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

Re: clean urls without /action/*

Subject: Re: clean urls without /action/*
Date: Wed, 06 Feb 2008 20:40:12 -0500
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: /*"
If you already knew all that, then I apologize if I've insulted your 
intelligence.
You make a valid point about the prefixes. I find them annoying as well. 
I'm sure we can accomplish the same thing the Struts filter does. I'll 
look into it and let you know if I get it working.
-Ben
Allen Halsey wrote:
With support for clean urls, Stripes is very close to supporting Restful URLs
which "provide users with a mental model of your site as a hierarchy of
information resources [... where ...] each URL maps to a resource." [1]
[1] http://www.artima.com/weblogs/viewpost.jsp?thread=153170
That's great, but the "/action" part is unhelpful in this regard; wasted
characters using up part of my 72 character budget for URLs that will fit on
one line without wrapping in an email.
I believe this is an example of the implementation unnecessarily imposing
itself into the URL space of the webapp. (Although not nearly as bad as
exposing .jsp or .asp extensions.)
Allen
Gregg Bolinger-7 wrote:
Seems like extra work for little gain. What is the problem with /action/home or /page/home or whatever you might choose?
Gregg
Allen Halsey wrote:
Leonard Gestrin wrote:
Or,  if it is an absolute must, you can map each of urls that you want
stripes to process individually.
    <servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>home</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>login</url-pattern>
    </servlet-mapping>
....
, but this is exactly one of the problems that stripes has solved.
    
        
It would be good if the build process could automatically add these
servlet mappings based on the url mappings.
Allen
-------------------------------------------------------------------------
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/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users
  
-------------------------------------------------------------------------
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/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy