WebWork - WebWork - tag

The URL tag builds an encoded URL. If you do not include a value, then the tag will point to the current page.

attribute required description
value no This attribute is used to pass data to the tag.
id no When specified, causes the URL not to printed to the output but rather stored in the ActionContext using the id as the key
scheme no can be "http" or "https"
includeContext no Determines whether the context path should be prepended to absolute urls or not. Default is true
encode no Determines if the contents should be escaped appropriately for valid HTML characters
includeParams no The includeParams attribute may have the value 'none' (no params), 'get'(only GET params) or 'all'(GET and POST params). It is used when the url tag is used without a value or page attribute. Its value is looked up on the ValueStack. If no includeParams is specified then 'get' is used.

In this example, the form action value will be an url hiturl.action that is encoded.

<form action="<ww:url value="'hiturl.action'"/>" method="POST">
    ...
  </form>

In this example, we are adding name/value pairs to the URL. The URL tag will build up the URL appropriately. You can also place them in the normal way with "?"; i.e., - 'hiturl.action?user=john'.

<form action="<ww:url value="'hiturl.action'">
      <ww:param name="'user'" value="'john'"/>
   </ww:url>" method="POST">
...
</form>

By default, port 80 is assumed to be the "http" port and port 443 is assumed to be the "https" port. However, some servers, such as Tomcat, use different default ports, such as 8080 and 8443. You can change these values by setting the configuration elements in webwork.properties:

  • webwork.url.http.port
  • webwork.url.https.port