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

Reply via email to