This page last changed on Dec 14, 2004 by plightbo.

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

attribute requireddescription
valuenoThis attribute is used to pass data to the tag.
idno When specified, causes the URL not to printed to the output but rather stored in the ActionContext using the id as the key
schemenocan be "http" or "https"
includeContext noDetermines whether the context path should be prepended to absolute urls or not. Default is true
encode noDetermines if the contents should be escaped appropriately for valid HTML characters
includeParams noThe 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

Document generated by Confluence on Dec 14, 2004 16:36