I am defining one variable in Parent JSP and accessing tag file from that jsp where the same variable is changing based on some conditions.
Here is my code ..
Parent JSP :
<c:set var="replaceParams" value=":${attribute.name}:${value.name}" />
<c:set var="removeURL" value="${fn:replace(queryParams, replaceParams, '')}" /> <!-- Suppose value is A -->
<%@ taglib prefix="cms2" tagdir="/WEB-INF/tags/spine/surgery"%>
<c:forEach items="${attributeDTOList}" var="attribute" varStatus="status">
<cms2:attributeSubFeatureRemove attribute="${attribute}" />
</c:forEach>
<!-- Print removeURL showing "A". It has to show "AB" -->
attributeSubFeatureRemove.tag--
<%@ attribute name="attribute" required="true" type="com.medtronic.b2b.core.dto.HCCB2BClassificationAttributeDTO" %>
<%@ attribute name="removeURL" required="true" type="java.lang.String" %>
<c:forEach items="${attribute.subFeatures}" var="subAttribute">
<c:forEach items="${subAttribute.attributeValues}" var="subValue">
<c:if test="${ subValue.preSelectionRequired}">
<c:set var="replaceParams" value=":${subAttribute.name}:${subValue.name}" />
<c:set var="removeURL" value="${fn:replace(removeURL, replaceParams, '')}" />
</c:if>
</c:forEach>
</c:forEach>
<!-- Now Suppose removeURL value changed to AB-->
In the above code Parent JSP is having variable removeURL which is of String Type. I am sending this removeURL variable inside tag file. Tag file will change the same removeURL variable to hold updated String.
Now If I will try to get removeURL in Parent JSP, it is print the same value as before in parent jsp. Updated calculation value (in tag file) is not reflecting in parent JSP.
I am confuse with scope whether it will make removeURL variable consistent or not. Please help me to get updated value in Parent JSP as well.