org.hdiv.components
Class URLHDIV
java.lang.Object
org.apache.struts2.components.Component
org.apache.struts2.components.URL
org.hdiv.components.URLHDIV
public class URLHDIV
- extends org.apache.struts2.components.URL
This tag is used to create a URL.
You can use the "param" tag inside the body to provide additional request
parameters.
NOTE:
When includeParams is 'all' or 'get', the parameter defined in param tag will take
precedence and will not be overriden if they exists in the parameter submitted.
For example, in Example 3 below, if there is a id parameter in the url where the
page this tag is included like http://://editUser.action?id=3333&name=John
the generated url will be http://:/context>/editUser.action?id=22&name=John
cause the parameter defined in the param tag will take precedence.
- action (String) - (value or action choose either one, if both exist value
takes precedence) action's name (alias)
-
- value (String) - (value or action choose either one, if both exist value
takes precedence) the url itself
- scheme (String) - http scheme (http, https) default to the scheme this
request is in
- namespace - action's namespace
- method (String) - action's method, default to execute()
- encode (Boolean) - url encode the generated url. Default is true
- includeParams (String) - The includeParams attribute may have the value
'none', 'get' or 'all'. Default is 'get'. none - include no parameters in the URL
get - include only GET parameters in the URL (default) all - include both GET and
POST parameters in the URL
- includeContext (Boolean) - determine wheather to include the web app context
path. Default is true.
Examples
<!-- START SNIPPET: example -->
<-- Example 1 -->
<s:url value="editGadget.action">
<s:param name="id" value="%{selected}" />
</s:url>
<-- Example 2 -->
<s:url action="editGadget">
<s:param name="id" value="%{selected}" />
</s:url>
<-- Example 3-->
<s:url includeParams="get" >
<:param name="id" value="%{'22'}" />
</s:url>
<!-- END SNIPPET: example -->
- Author:
- Gorka Vicente
- See Also:
Param
| Nested classes/interfaces inherited from class org.apache.struts2.components.URL |
org.apache.struts2.components.URL.ExtraParameterProvider |
| Fields inherited from class org.apache.struts2.components.URL |
action, ALL, anchor, encode, extraParameterProvider, GET, includeContext, includeParams, method, namespace, NONE, portletMode, portletUrlType, scheme, urlIncludeParams, value, windowState |
| Fields inherited from class org.apache.struts2.components.Component |
actionMapper, COMPONENT_STACK, id, parameters, stack |
|
Constructor Summary |
URLHDIV(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Constructor |
|
Method Summary |
boolean |
end(java.io.Writer writer,
java.lang.String body)
Callback for the end tag of this component. |
org.hdiv.dataComposer.IDataComposer |
getDataComposer()
|
protected void |
mergeRequestParameters(java.lang.String value,
java.util.Map parameters,
java.util.Map contextParameters)
Merge request parameters into current parameters. |
| Methods inherited from class org.apache.struts2.components.URL |
setAction, setAnchor, setEncode, setExtraParameterProvider, setIncludeContext, setIncludeParams, setMethod, setNamespace, setPortletMode, setPortletUrlType, setScheme, setUrlIncludeParams, setValue, setWindowState, start |
| Methods inherited from class org.apache.struts2.components.Component |
addAllParameters, addParameter, altSyntax, copyParams, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getComponentStack, getId, getParameters, getStack, popComponentStack, setActionMapper, setId, toString, usesBody |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLHDIV
public URLHDIV(com.opensymphony.xwork2.util.ValueStack stack,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
- Constructor
- Parameters:
stack - OGNL value stack.req - http requestres - http response
end
public boolean end(java.io.Writer writer,
java.lang.String body)
- Callback for the end tag of this component. Should the body be evaluated
again? NOTE: will pop component stack.
- Overrides:
end in class org.apache.struts2.components.URL
- Parameters:
writer - the output writer.body - the rendered body.
- Returns:
- true if the body should be evaluated again
getDataComposer
public org.hdiv.dataComposer.IDataComposer getDataComposer()
- Returns:
- Returns HDIV's data composer.
mergeRequestParameters
protected void mergeRequestParameters(java.lang.String value,
java.util.Map parameters,
java.util.Map contextParameters)
- Merge request parameters into current parameters. If a parameter is already
present, than the request parameter in the current request and value atrribute
will not override its value. The priority is as follows:-
- parameter from the current request (least priority)
- parameter form the value attribute (more priority)
- parameter from the param tag (most priority)
- Overrides:
mergeRequestParameters in class org.apache.struts2.components.URL
- Parameters:
value - the value attribute (url to be generated by this component)parameters - component parameterscontextParameters - request parameters
Copyright © 2008 hdiv.org. All Rights Reserved.