JSP pass and retrieve variables – ATG

 

Parent JSP:

<dsp:include page=”/common/getTaxedPrice.jsp”>
<dsp:param name=”freePrice” value=”${paymentCost}”/>
</dsp:include>

 

Child JSP:

Read passed value:

<dsp:getvalueof param=”freePrice” var=”freePrice”/>

 

Pass value to parent JSP:

Option 1 – DSP TAGS:

<dsp:getvalueof param=”intergerlVal” var=”integerValue” scope=”request” />
<dsp:getvalueof param=”decimalVal” var=”decimalValue” scope=”request”/>

Option 2 – JSTL:

<c:set var=”integerValue” scope=”request” value=”integerValue”></c:set>

<c:set var=”decimalValue” scope=”request” value=”decimalValue”></c:set>

 

Parent JSP:

Variables can be printed or used as:

${integerValue}

${decimalValue}