Defines a link to a target destination.
<dsp:alink
-
destination
link-text
[
param
-
list
]
[property-setting
s
]
[
anchorid="id
"]
[
requiresSessionConfirmation="{true|false}"]
[dynamic attributes]
</dsp:a>
Attributes
link-destination
Specifies the link destination with one of the following attributes:
Attribute | Description |
---|---|
| Set to path and file name. Resolves relative paths using the current page as a starting point. Resolves absolute paths using the Web server doc root as a starting point. |
| Set to path and file name. Resolves relative paths using the current page as a starting point. Resolves absolute paths using the Web application root as a starting point by prepending the request object’s |
param-list
One or more embedded dsp:param tags that specify the parameters to pass to the link destination. For example:
<dsp:a href="homepage.jsp">Go to your home page <dsp:param name="city" beanvalue="Profile.homeAddress.city"/> </dsp:a>
property-settings
Specifies settings for one or more bean properties. To set a single property, use the following syntax:
bean="property-spec
"source-spec
In order to set multiple properties within the same dsp:a
tag, embed multiple dsp:property
tags as follows:
<dsp:property bean="property-spec
"source-spec
/> <dsp:property bean="
property-spec
"source-spec
/> ...
In both cases, set
property-spec
and
source-spec
as follows:
property-spec
specifies the property to update: its Nucleus path, component name, and property name. The property specification can also include a tag converter, such as date or null. For more information, see Tag Converters.source-spec
specifies the source value in one of the following ways:beanvalue="
property
-
spec
"
Specifies a property value, where
property-spec
includes a Nucleus path, component name, and property name. For example:bean="Student_01.firstClass" beanvalue="FreshmanScience.name"
paramvalue="
param-name
"
Specifies the value from the page parameter
param-name
. For example:bean="Student_01.name" paramvalue="name"
value="
value
"
Specifies a static value. For example:
bean="Student_01.enrolled" value="true"
Note: The same dsp:a tag cannot use both methods to set properties.
anchorid
Assigns a page-unique identifier to the anchor. Property-setting anchors require unique IDs when a page specifies multiple anchors and does not consistently display all of them. By providing an anchor ID, you can reliably reference this anchor.
requiresSessionConfirmation
Set to true in order to prevent cross-site attacks. If set to true, activation of this dsp:a
tag supplies the request parameter _dynSessConf
, which contains a randomly generated session long number that is associated with the current session. On receiving this request, the request-handling pipeline validates _dynSessConf
against the current session’s confirmation number. If it detects a mismatch or missing number, it blocks further request processing.
dynamic attributes
Include additional attributes as needed for the output that your JSP will generate. This tag will pass the attributes into the corresponding output tag. The names of the attributes you include are not validated by the dsp tag library.
Usage Notes
Like an HTML anchor tag, dsp:a
defines a link with a target destination. dsp:a
can also update a servlet bean property value and pass a page parameter to the destination page.
Note: dsp:a
uses the iclass
attribute in place of the cascading stylesheet class attribute to avoid using a Java reserved word in Java code.
Example
<dsp:a href="index.jsp" bean="/samples/Student_01.name" paramvalue="userName">Click here to set the name</dsp:a>
In this example, the text Click here to set the name
is a link. When clicked, the ATG platform sets the name
property of the Student_01
component to the value held by the userName
page parameter and opens index.jsp
.