[ http://mc4j.org/jira/browse/STS-262?page=comments#action_10570 ] 
            
Remi VANKEISBELCK commented on STS-262:
---------------------------------------

Hi again folks !

Here is the latest version of the code. It should have no impact on existing 
stuff, and allows clean URLs without being intrusive with Stripes itself : it's 
now all about dropping a jar and modifying web.xml... the plugin way :-)

Below is a web.xml filter config example, and I'll attach the zipped sources 
right now.

Even if you don't plan to implement anything in there, please test that and 
send some feedback if you can ! It's about 15 minutes to integrate that into 
your apps and try it out :

1/ include the clean URLs sources to your project or recompile it and include a 
jar...
2/ modify the Stripes filter config in web.xml as shown below
3/ define a clean url expression for some of your actions, using @UrlBinding 
(e.g. @UrlBinding("/action/@DoIt/:param/") or 
@UrlBinding("/store/product/:id/:_eventName) etc.)
4/ start the app, open up your web browser, and issue a GET to your action 
(e.g. http://.../myApp/action/DoIt/blah or 
http://.../myApp/store/product/123/show etc.)

I'm using it in some application I develop, and so far it's been working fine : 
all existing stuff still works, and so does clean URLs for the actions that 
define clean url expressions in their @UrlBinding...

Thanks in advance for any feedback and help with that.

Cheers !

Remi

------------------------------
web.xml example : 

    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!--              Configuration of the Stripes Filter.                   -->
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <filter>
        <description>
            Provides essential configuration and request processing services
            for the Stripes framework with clean URLs enabled !
        </description>
        <display-name>Stripes Filter</display-name>
        <filter-name>StripesFilter</filter-name>
        
<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
        <init-param>
            <param-name>ActionResolver.PackageFilters</param-name>
            <param-value>net.sourceforge.jfacets.woko.actions.*</param-value>
        </init-param>

        <init-param>
            <param-name>Configuration.Class</param-name>
            
<param-value>net.sourceforge.stripes.config.RuntimeConfiguration</param-value>
        </init-param>

        <!-- clean URLs (action resolver + interceptor)... -->
        <init-param>
            <param-name>ActionResolver.Class</param-name>
            
<param-value>net.sourceforge.stripes.cleanurls.CleanUrlActionResolver</param-value>
        </init-param>
        <init-param>
                        <param-name>Interceptor.Classes</param-name>
                        <param-value>
                net.sourceforge.stripes.cleanurls.CleanUrlInterceptor,
                net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor
                        </param-value>
                </init-param>
    </filter>

> Friendly URL support
> --------------------
>
>                 Key: STS-262
>                 URL: http://mc4j.org/jira/browse/STS-262
>             Project: Stripes
>          Issue Type: New Feature
>          Components: ActionBean Dispatching
>            Reporter: Tim Fennell
>         Assigned To: Tim Fennell
>             Fix For: Release 1.5
>
>         Attachments: cleanurls-patches.zip
>
>
> One thing that comes up frequently is support for friendly URLs, e.g.:
>   /blog/2006/08/22
>   /user/6282/edit
> and so on.  While it's possible to acheive URLs like this using 3rd party 
> tools like UrlRewriteFilter it would be nice if they were built directly into 
> stripes because then all URL information could be kept in a single place for 
> each class.
> I'm envisaging an annotation something like this:
>     @UrlInfo("/{year}/{month}/{day}")
>     @UrlInfo("/{userId}/{event}")
> that would inform Stripes how to map the extra pieces of information encoded 
> in the URL.
> Optionally this could also be specified with the existing UrlBinding 
> annotations, e.g.
>     @UrlBinding("/blog/{year}/{month}/{day}")
> If done right, the stripes url and link tags could also take advantage of 
> this information to put certain parameters into the URL instead of a 
> parameter string.
> I'm very open to hearing alternative ideas around how to specify this, and 
> other functionality that would be desirable.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to