if (result instanceof ValueExpression) {
if (scope != PageContext.PAGE_SCOPE) {
throw new JspException(
Resources.getMessage("SET_BAD_SCOPE_DEFERRED"));
}
VariableMapper vm =
pageContext.getELContext().getVariableMapper();
if (vm != null) {
vm.setVariable(var, (ValueExpression)result);
}
} else {
// Make sure to clear any previous mapping for this
// variable in the variable mapper.
if (scope == PageContext.PAGE_SCOPE) {
VariableMapper vm =
pageContext.getELContext().getVariableMapper();
if (vm != null) {
vm.setVariable(var, null);
}
}
pageContext.setAttribute(var, result, scope);
}
} else {
if (scopeSpecified)
pageContext.removeAttribute(var, scope);
else
pageContext.removeAttribute(var);
if (scope == PageContext.PAGE_SCOPE) {
VariableMapper vm =
pageContext.getELContext().getVariableMapper();
if (vm != null) {
vm.setVariable(var, null);
}
}
}
} else if (target != null) {