net.sourceforge.stripes.action
Annotation Type UrlBinding


@Retention(value=RUNTIME)
@Target(value=TYPE)
@Documented
public @interface UrlBinding

Annotation used to bind ActionBean classes to a specific path within the web application. The AnnotatedClassActionResolver will examine the URL submitted and extract the section that is relative to the web-app root. That will be compared with the URL specified in the UrlBinding annotation, to find the ActionBean that should process the chosen request.

Stripes supports "Clean URLs" through the UrlBinding annotation. Parameters may be embedded in the URL by placing the parameter name inside braces ({}). For example, @UrlBinding("/foo/{bar}/{baz}") maps the action to "/foo" and indicates that the "bar" and "baz" parameters may be embedded in the URL. In this case, the URL /foo/abc/123 would invoke the action with bar set to "abc" and baz set to "123". The literal strings between parameters can be any string.

The special parameter name $event may be used to embed the event name in a clean URL. For example, given @UrlBinding("/foo/{$event}") the "bar" event could be invoked with the URL /foo/bar.

Clean URL parameters can be assigned default values using the = operator. For example, @UrlBinding("/foo/{bar=abc}/{baz=123}"). If a parameter with a default value is missing from a request URL, it will still be made available as a request parameter with the default value. Default values are automatically embedded when building URLs with the Stripes JSP tags. The default value for $event is determined from the DefaultHandler and may not be set in the @UrlBinding.

Clean URLs support both prefix mapping (/action/foo/{bar}) and extension mapping (/foo/{bar}.action). Any number of parameters and/or literals may be omitted from the end of a request URL.

Author:
Tim Fennell

Required Element Summary
 String value
          The web-app relative URL that the ActionBean will respond to.
 

Element Detail

value

public abstract String value
The web-app relative URL that the ActionBean will respond to.



© Copyright 2005-2006, Stripes Development Team.