- 
- All Implemented Interfaces:
 ClientBehaviorHolder,PartialStateHolder,StateHolder,TransientStateHolder,ValueHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
public class Link extends HtmlOutcomeTargetLink
The
<o:link>is a component that extends the standard<h:link>and allows including the request query string parameters of the current URL into the link's target URL. Standard Faces<h:link>does not include any query string parameters which are not declared as view parameters. This is particularly useful if you expect some state in the target page and don't want to repeat<f|o:param>all over place.You can use it the same way as
<h:link>, you only need to changeh:too:.Include request params
When you want to include request query string parameters of the current URL into the link's target URL, set the
includeRequestParamsattribute totrue.<o:link value="Go to some page with same query string" outcome="some-page" includeRequestParams="true">
- Since:
 - 4.5
 - Author:
 - Bauke Scholtz
 - See Also:
 ActionURLDecorator
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENT_TYPEThe component type, which is "org.omnifaces.component.output.Link".- 
Fields inherited from class jakarta.faces.component.UIOutcomeTarget
COMPONENT_FAMILY 
- 
Fields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY 
 - 
 
- 
Constructor Summary
Constructors Constructor Description Link() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidencodeBegin(FacesContext context)booleanisIncludeRequestParams()Returns whether or not the request parameters should be encoded into the form's action URL.voidsetIncludeRequestParams(boolean includeRequestParams)Set whether or not the request parameters should be encoded into the form's action URL.- 
Methods inherited from class jakarta.faces.component.html.HtmlOutcomeTargetLink
getAccesskey, getCharset, getCoords, getDefaultEventName, getDir, getEventNames, getHreflang, getLang, getOnblur, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getRel, getRev, getRole, getShape, getStyle, getStyleClass, getTabindex, getTarget, getTitle, getType, isDisabled, setAccesskey, setCharset, setCoords, setDir, setDisabled, setHreflang, setLang, setOnblur, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setRel, setRev, setRole, setShape, setStyle, setStyleClass, setTabindex, setTarget, setTitle, setType 
- 
Methods inherited from class jakarta.faces.component.UIOutcomeTarget
getFamily, getOutcome, isDisableClientWindow, isIncludeViewParams, setDisableClientWindow, setIncludeViewParams, setOutcome 
- 
Methods inherited from class jakarta.faces.component.UIOutput
clearInitialState, getConverter, getLocalValue, getValue, markInitialState, resetValue, restoreState, saveState, setConverter, setValue 
- 
Methods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent 
- 
Methods inherited from class jakarta.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface jakarta.faces.component.behavior.ClientBehaviorHolder
addClientBehavior, getClientBehaviors 
 - 
 
 - 
 
- 
- 
Field Detail
- 
COMPONENT_TYPE
public static final String COMPONENT_TYPE
The component type, which is "org.omnifaces.component.output.Link".- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
encodeBegin
public void encodeBegin(FacesContext context) throws IOException
- Overrides:
 encodeBeginin classUIComponentBase- Throws:
 IOException
 
- 
isIncludeRequestParams
public boolean isIncludeRequestParams()
Returns whether or not the request parameters should be encoded into the form's action URL.- Returns:
 - Whether or not the request parameters should be encoded into the form's action URL.
 
 
- 
setIncludeRequestParams
public void setIncludeRequestParams(boolean includeRequestParams)
Set whether or not the request parameters should be encoded into the form's action URL.- Parameters:
 includeRequestParams- Whether or not the request parameters should be encoded into the form's action URL.
 
 - 
 
 -