Author: markt
Date: Fri Dec  5 22:43:48 2014
New Revision: 1643465

URL: http://svn.apache.org/r1643465
Log:
Follow up to r1643365/r1643366. BZ57309.
Fix unit test failure.

Modified:
    tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java

Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java?rev=1643465&r1=1643464&r2=1643465&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Set.java Fri Dec  
5 22:43:48 2014
@@ -68,14 +68,14 @@ public class Set implements TagPlugin {
         //get the iScope according to the strScope
         iScope = Util.getScope(strScope);
 
+        String jspCtxt = null;
+        if (ctxt.isTagFile()) {
+            jspCtxt = "this.getJspContext()";
+        } else {
+            jspCtxt = "_jspx_page_context";
+        }
         //if the attribute var has been specified then assign the result to 
the var;
         if(hasVar){
-            String jspCtxt = null;
-            if (ctxt.isTagFile()) {
-                jspCtxt = "this.getJspContext()";
-            } else {
-                jspCtxt = "_jspx_page_context";
-            }
             String strVar = ctxt.getConstantAttribute("var");
             ctxt.generateJavaSource("if(null != " + resultName + "){");
             ctxt.generateJavaSource("    " + jspCtxt + ".setAttribute(\"" + 
strVar + "\"," + resultName + "," + iScope + ");");
@@ -144,7 +144,7 @@ public class Set implements TagPlugin {
 
             //invoke the method through the reflection
             ctxt.generateJavaSource("                    if(" + resultName + " 
!= null){");
-            ctxt.generateJavaSource("                        " + methodName + 
".invoke(" + targetName + ", new 
Object[]{org.apache.el.lang.ELSupport.coerceToType(" + resultName + ", " + 
methodName + ".getParameterTypes()[0])});");
+            ctxt.generateJavaSource("                        " + methodName + 
".invoke(" + targetName + ", new 
Object[]{org.apache.el.lang.ELSupport.coerceToType(" + jspCtxt + 
".getELContext(), " + resultName + ", " + methodName + 
".getParameterTypes()[0])});");
             ctxt.generateJavaSource("                    }else{");
             ctxt.generateJavaSource("                        " + methodName + 
".invoke(" + targetName + ", new Object[]{null});");
             ctxt.generateJavaSource("                    }");



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to