View | Details | Raw Unified | Return to bug 54012
Collapse All | Expand All

(-)org/apache/jasper/tagplugins/jstl/core/Set.java (-3 / +9 lines)
Lines 70-83 Link Here
70
        
70
        
71
        //if the attribute var has been specified then assign the result to the var;
71
        //if the attribute var has been specified then assign the result to the var;
72
        if(hasVar){
72
        if(hasVar){
73
            String jspCtxt = null;
74
            if (ctxt.isTagFile()) {
75
                jspCtxt = "this.getJspContext()";
76
            } else {
77
                jspCtxt = "_jspx_page_context";
78
            }
73
            String strVar = ctxt.getConstantAttribute("var");
79
            String strVar = ctxt.getConstantAttribute("var");
74
            ctxt.generateJavaSource("if(null != " + resultName + "){");
80
            ctxt.generateJavaSource("if(null != " + resultName + "){");
75
            ctxt.generateJavaSource("    pageContext.setAttribute(\"" + strVar + "\"," + resultName + "," + iScope + ");");
81
            ctxt.generateJavaSource("    "+jspCtxt+".setAttribute(\"" + strVar + "\"," + resultName + "," + iScope + ");");
76
            ctxt.generateJavaSource("} else {");
82
            ctxt.generateJavaSource("} else {");
77
            if(hasScope){
83
            if(hasScope){
78
                ctxt.generateJavaSource("    pageContext.removeAttribute(\"" + strVar + "\"," + iScope + ");");
84
                ctxt.generateJavaSource("    "+jspCtxt+".removeAttribute(\"" + strVar + "\"," + iScope + ");");
79
            }else{
85
            }else{
80
                ctxt.generateJavaSource("    pageContext.removeAttribute(\"" + strVar + "\");");
86
                ctxt.generateJavaSource("    "+jspCtxt+".removeAttribute(\"" + strVar + "\");");
81
            }
87
            }
82
            ctxt.generateJavaSource("}");
88
            ctxt.generateJavaSource("}");
83
            
89
            

Return to bug 54012