Home > Contents > Index >  
Template Tags TOC   |    Alpha TOC   |    Tag Family TOC   |    Purpose TOC   |    Annotated TOC   |    Index 

 

render:encode

Produces a complete URL (from the servlet name onward) from the arguments, previously packed arguments, and the servlet name (usually ContentServer or BlobServer) provided.

Syntax

Parameters

str (required)
Input. Name of the servlet to use when rendering the URL, either ContentServer or BlobServer. You can include all the information for the URL to the left of the page name (which is supplied dynamically). For example:

outstr (required)
Input. Name of the variable that stores the URL generated by this tag.

addsession (optional)
Input. Specifies whether to include session IDs in the URL when a browser is set to reject cookies. true means to encode session IDs in the URL. If this parameter is not specified, it is set to true by default.

render:argument (optional)
Input. Name/value pairs to pass to the tag. The names and values of these arguments are URL-encoded and incorporated into the final URL.

An argument passed in with this parameter takes precedence over an argument passed in with the packedargs parameter. If the same argument is passed in with both, the packedargs version is overridden by the argument version.

packedargs (optional)
Input. Previously created URL-encoded packed arguments, in standard form; that is, the output from a previous render:packargs tag.

Description

This tag creates a URL based on the arguments and packed arguments that are passed to it. All characters in the URL are URL-encoded.

Call the standard Sites GetPageURL element to obtain URLs for hyperlinks on a page. That element is coded to preserve and resolve the various Sites variables that are necessary for rendering pages in the Sites environment. However, in special cases, you might need to use this tag to obtain a URL instead.

For example, if your site is static but you want to present a dynamic URL inside a static HTML file, use this tag. A URL created with this tag remains dynamic, even when passed through the Export to Disk publishing method. That is, Export to Disk does not translate a dynamic URL created by this tag into a static HTML file.

On a dynamic site, you can use this tag if your page or pagelet exists completely outside of the Sites environment and you do not need to preserve any of the Sites variables (c, cid, ct, p) other than rendermode when creating a URL for it.

This tag completes the appropriate URL encoding required for all the arguments passed to it--with the exception of arguments passed in as packedargs which are assumed to be already URL-encoded. (The render:packargs tag URL-encodes arguments passed to it, which are the arguments you pass in to render:encode as packedargs.)

This tag also includes session IDs in the URL, according to the conventions of the local application server, if a browser is set to reject cookies.

Error Numbers

The possible values of errno include:

Value Description
-1004 An argument is missing.

Example

This code uses render:packargs to URL-encode the name of the site as a string and then uses render:encode to create a URL that includes that encoded string:

See Also

render:packargs

   Home > Contents > Index >

Oracle JSP Tag Reference
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.