HDIV API 2.0.4

org.hdiv.components
Class URLHDIV

java.lang.Object
  extended by org.apache.struts2.components.Component
      extended by org.apache.struts2.components.URL
          extended by 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.

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"  >
           &lt:param name="id" value="%{'22'}" />
       </s:url>
      
       <!-- END SNIPPET: example -->
 

Author:
Gorka Vicente
See Also:
Param

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.struts2.components.URL
org.apache.struts2.components.URL.ExtraParameterProvider
 
Field Summary
 
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
 

Constructor Detail

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 request
res - http response
Method Detail

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:-

Overrides:
mergeRequestParameters in class org.apache.struts2.components.URL
Parameters:
value - the value attribute (url to be generated by this component)
parameters - component parameters
contextParameters - request parameters

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.