The ItemLink servlet bean takes a repository item as input and uses a URL template to construct a static or dynamic link to that item, depending on the value of the HTTP request’s User-Agent property. It uses an indirect URL template if the visitor is a web spider, and a direct URL template otherwise.

For a given item descriptor, there can be multiple URL templates. The one selected is based on matching the value of the HTTP request’s User-Agent property to the browser types in the template’s configuration.

Most of the information needed by the servlet bean is provided using its input parameters. However, there are a few properties that you can set as well:

defaultItemDescriptorName
Specifies the value to use for the itemDescriptorName input parameter, if the input parameter is not supplied.

defaultRepository
Specifies the value to use for the repository input parameter, if the input parameter is not supplied.

defaultWebApp
Specifies the default web application to use when determining the context path for a URL.

Note: If you embed the ItemLink servlet bean in the Cache servlet bean, you must be sure to create separate cache keys for human visitors and web spiders (which can be differentiated based on the UserAgent value of the request). Otherwise the page may end up containing the wrong type of URL for the visitor.

For additional information about the ItemLink servlet bean, see the ATG Page Developer's Guide.

 
loading table of contents...