You could use the DynamicMappingFilter defined like this in your web.xml

<filter>
        <filter-name>DynamicMappingFilter</filter-name>

<filter-class>net.sourceforge.stripes.controller.DynamicMappingFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>DynamicMappingFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

Then on your action bean, define a url binding like so

@UrlBinding("/invitecode/{code}/")
public class InviteCodeActionBean ..... {

    private String code;
    .......
}

Keep in mind that you'll need a method marked as @DefaultHandler since your
URL doesn't specify an event.

Gregg

On Sat, Mar 28, 2009 at 9:36 PM, Daniel Cane <[email protected]> wrote:

> team,
>
> i have stripes working like a pro with my app, so this is not a basic setup
> question.
>
> i currently have the standard
>
>       <servlet-mapping>
>               <servlet-name>DispatcherServlet</servlet-name>
>               <url-pattern>*.action</url-pattern>
>       </servlet-mapping>
>
> which works great. how do i accomplish the following
>
> I want to allow for a "special" url to be mapped to stripes. my standard
> urls are
> http://mysite.com/app/foo.action
> http://mysite.com/app/bar.action
>
> i want to create a special mapping to allow users to go to:
> http://mysite.com/invitecode/<theirinvitecode>
>
> thus - I want /invitecode/* to map to InviteCodeActionBean and then be able
> to access the subsequent data as a parameter. I knew how to do this in
> struts, but seems to be getting tangled up with stripes on this one. I know
> there must be a dozen ways to do it, but i'll settle for one that works. :)
>
> thanks in advance.
>
> dan
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to