PathParam
is a component that extends the OmniFaces Param
to support
MultiViews
feature of FacesViews
. It is done by rendering the supplied parameters
of such components as <h:link>
and <h:button>
among others as path parameters and not as
query parameters as otherwise will be produced by <o:param>
and <f:param>
tags.
The component has built-in support for a Converter
to convert the supplied value to string by usual means via
the converter
attribute of the tag, or the nested <f:converter>
tag, or just automatically
if a converter is already registered for the target class via @FacesConverter(forClass)
.
This component doesn't support returning encoded output of its children as parameter value in case no value is present.
This feature is provided by Param
component instead.
Also, the name attribute must not be specified for this component as it already evaluates to a predefined one.
This component is used to create bookmarkable URLs via standard outcome target components that take into account
<o:pathParam>
tags nested in the components. The path parameters will be rendered
in the order they were declared for a view id that is defined as a multi view and if the view was
not defined as a multi view then they won't be rendered at all. Additionally, declaring path parameters
for a non-multi view will be logged as a warning and a faces warning message will be added for any
stage different from Production
.
In the following example the link to the multi view page will be rendered with two path parameters:
<h:link value="Link" outcome="multiview-supported-path"> <o:pathParam value="first" /> <o:pathParam value="second" /> </h:link>The code above will be rendered as:
<a id="..." name="..." href="/context-path/multiview-supported-path/first/second">Link</a>
.
The path parameters will be available via @Inject @Param(pathIndex=0) private String first;
and
@Inject @Param(pathIndex=1) private String second;
the usual way.
Info | Value |
---|---|
Component Type | org.omnifaces.component.output.PathParam |
Handler Class | None |
Renderer Type | None |
Description | None |
Name | Required | Type | Description |
---|---|---|---|
id | false | jakarta.el.ValueExpression
(must evaluate to java.lang.String )
| The component identifier for this component. This value must be unique within the closest parent component that is a naming container. |
binding | false | jakarta.el.ValueExpression
(must evaluate to jakarta.faces.component.UIComponent )
|
The ValueExpression linking this component to a property in a backing bean.
|
converter | false | jakarta.el.ValueExpression
(must evaluate to jakarta.faces.convert.Converter )
| Converter instance registered with this component. |
disable | false | jakarta.el.ValueExpression
(must evaluate to boolean )
| Flag enabling or disabling the inclusion of the parameter. |
value | false | jakarta.el.ValueExpression
(must evaluate to java.lang.Object )
| Value of the parameter to be set. |
Output generated by Vdldoc View Declaration Language Documentation Generator.