Actually, because the event parameter is a special case, it does use the
special $ prefix to indicate that. (Perhaps a poor choice on my part because
it makes it look like JSP EL.) Whereas most embedded parameters work just
like normal ones -- {foo} means a parameter named "foo" with the value in
the request path -- the $event parameter works differently: {$event} exposes
a parameter with the *name* specified by the value in the request path.

Jeroen, I have done a bunch of work for Stripes 1.5.1 to make clean URLs
smarter. Please check out the trunk from SVN and see if it behaves more like
you expect.

-Ben

On Mon, Nov 24, 2008 at 9:49 AM, Poitras Christian <
[EMAIL PROTECTED]> wrote:

>  The correct syntax is {event}.
>
> Christian.
>
>  ------------------------------
> *From:* Jeroen van Wilgenburg [mailto:[EMAIL PROTECTED]
> *Sent:* Saturday, November 22, 2008 11:11 AM
> *To:* [email protected]
> *Subject:* [Stripes-users] {$event} cannot be the first element in
> UrlBinding
>
>   Hi,
>
> I'm trying some things with @UrlBinding and {$event} and ran into a small
> problem.
>
> I started with:
>
> @UrlBinding("/welcome/{$event}.action")
> public class WelcomeActionBean extends AbstractActionBean {
>
>   @DefaultHandler
>   public Resolution normal(){
>       return new ForwardResolution("/normal.jsp");
>   }
>
>   public Resolution admin(){
>       return new ForwardResolution("/admin.jsp");
>   }
>
> }
>
> I access the application with the url
> http://localhost:8080/app/welcome/.action
> This works fine (although the url is a bit odd, but it's just a test)
>
> The following binding also works fine:
> @UrlBinding("/hello/{$event}/welcome.action")
> The access url is http://localhost:8080/app/hello/welcome.action.
> Note that the event disappeared because of the @DefaultHandler
>
> But when I try the following annotation:
> @UrlBinding("/{$event}/welcome.action")
>
> I get strange errors. The url's made with <stripes:link/> render correctly,
> but when I click on them I get this:
>
> net.sourceforge.stripes.exception.ActionBeanNotFoundException: Could
> not locate an ActionBean that is bound to the URL
> [/admin/welcome.action]. Commons reasons for this include mis-matched
> URLs and forgetting to implement ActionBean in your class. Registered
> ActionBeans are: {/controller/DefaultView.action=class
> net.sourceforge.stripes.controller.DefaultViewActionBean, /=class
> com.xebia.web.WelcomeActionBean, //welcome.action=class
> com.xebia.web.WelcomeActionBean}
>
> The url to enter the application is
> http://localhost:8080/app//welcome.action which is also a bit odd (note
> the double slashes).
>
> Am I doing something wrong or isn't it allowed to use {$event} for
> the first element?
>
> Thanks for your help,
>
> Jeroen van Wilgenburg
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to