ATG JSP tags with sample codes


Below are the few usages of JSP tags in ATG context.

1.Setting Bean values in different ways

Setting Bean from a parameter

<dsp:a href="myfile.jsp" bean="mybean.name" paramvalue="user">

some text...

</dsp:a>

Setting Bean from a constant

<dsp:a href="myfile.jsp" bean="mybean.name" value="sebastian">

some text...

</dsp:a>

2.<dsp:getvalueof></dsp:getvalueof>

<dsp:getvalueof id="name" bean="mybean.name" idtype="java.lang.String">

this can be used inside other tags(dsp or jstl) or in the page itself using scriplet tags.given below one usage.

<c:if test="${empty name}">

<c:set var="name" value="atg_store_formValidationError"/>

</c:if>

3.<dsp:setvalue/>

The setvalue tag allows you to set a bean property or page parameter with a value copied from another bean property,page parameter or constant.

Setting a parameter value to bean value

<dsp:setvalue param="myparam" beanvalue="mybean.name"/>

setting a bean value to a page parameter

<dsp:setvalue bean="mybean.name" paramvalue="myparam"/>

setting a parameter value to a constant

<dsp:setvalue param="myparam" value="Hello World"/>

setting a bean value to a constant

<dsp:setvalue bean="mybean.name" value="Hello World"/>

4.<dsp:param/>

Setting param from constant

<dsp:param name="amount" value="20.12"/>

setting param from a component

<dsp:param name="repository" bean="/atg/userprofiling/ProfileAdapterRepository" />

setting param from an inscope parameter

<dsp:param name="id" value="element.repositoryId"/>

See usages for other tags as well.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...