@Retention(value=RUNTIME) @Target(value=TYPE) @Inherited @Documented public @interface URLMapping
Annotation representing a single PrettyFaces mapping that maps URLs to Faces Views.
All URLAction and URLQueryParameter annotations placed on
methods or fields of the annotated class will automatically refer to this
mapping.
| Modifier and Type | Required Element and Description |
|---|---|
String |
pattern
Specify the pattern for which this URL will be matched.
|
String |
viewId
Specify the JSF ViewId displayed by this mapping, by either calling an EL
Method (must return an object for which the toString() method will return
the view Id) or by returning a literal String value.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
beanName
The name that can be used to access instances of this bean in EL
expressions.
|
String |
id
Each
URLMapping must specify a unique id in order to participate
in PrettyFaces navigation. |
boolean |
onPostback
Optional boolean (default true), if set to
false, path
parameters will not be injected on form postbacks. |
boolean |
outbound
Enable or disable outbound URL rewriting for this mapping (default: 'true'
/ enabled.) If enabled, any links matching the viewId specified will be
rewritten (if possible) using parameters mapping to named path parameters
specified in the pattern.
|
String |
parentId
Specify an optional parent
id() from which this mapping
will inherit the base pattern, and path parameter validators. |
URLValidator[] |
validation
Specify any number of pattern validators for this mapping.
|
public abstract String pattern
Specify the pattern for which this URL will be matched. This element is required.
Any EL expressions #{someBean.paramName} found within the pattern will be processed as value injections. The URL will be parsed and the value found at the location of the EL expression will be injected into the location specified in that EL expression. Note: EL expressions will not match over the ‘/’ character.
The pattern itself is compiled parsed as a regular expression, meaning that the actual URL matching can be as simple or as complex as desired.
public abstract String viewId
Specify the JSF ViewId displayed by this mapping, by either calling an EL Method (must return an object for which the toString() method will return the view Id) or by returning a literal String value. This element is required.
The ViewId may be any resource located within the current Servlet Context: E.g. PrettyFaces can also forward to a non-Faces servlet.
public abstract String id
URLMapping must specify a unique id in order to participate
in PrettyFaces navigation.public abstract String parentId
Specify an optional parent id() from which this mapping
will inherit the base pattern, and path parameter validators.
<url-mapping id="store">
<pattern value="/store/" />
<~-- Result: /store/ -->
<view-id>/faces/shop/store.jsf</view-id>
</url-mapping>
<url-mapping parentId="store" id="category">
<pattern value="/#{category}" />
<~-- Result: /store/#{category} -->
<view-id>/faces/shop/category.jsf</view-id>
</url-mapping>
<url-mapping parentId="category" id="item">
<pattern value="/#{item}" />
<~-- Result: /store/#{category}/#{item} -->
<view-id>/faces/shop/item.jsf</view-id>
</url-mapping>
<url-mapping parentId="category" id="sales">
<pattern value="/sales" />
<~-- Result: /store/#{category}/sales -->
<view-id>/faces/shop/sales.jsf</view-id>
</url-mapping>
public abstract URLValidator[] validation
Specify any number of pattern validators for this mapping. Validators may be attached to individual parameters in each dynamic URL.
Please not that the index property of the
URLValidator annotations must be set to identify the path
parameter you want the validation to refer to.
public abstract boolean outbound
public abstract String beanName
The name that can be used to access instances of this bean in EL
expressions. Setting this attribute is equivalent to adding a
URLBeanName annotation to the class.
URLBeanNamepublic abstract boolean onPostback
Optional boolean (default true), if set to false, path
parameters will not be injected on form postbacks.
Copyright © 2014 OCPsoft. All Rights Reserved.