You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/11/06 15:52:01 UTC

svn commit: r1406156 - /tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java

Author: markt
Date: Tue Nov  6 14:52:00 2012
New Revision: 1406156

URL: http://svn.apache.org/viewvc?rev=1406156&view=rev
Log:
Fix where possible and silence where not possible some deprecation warnings

Modified:
    tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java

Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1406156&r1=1406155&r2=1406156&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Tue Nov  6 14:52:00 2012
@@ -28,6 +28,7 @@ import java.util.Enumeration;
 import java.util.HashMap;
 
 import javax.el.ELContext;
+import javax.el.ELException;
 import javax.el.ExpressionFactory;
 import javax.el.ValueExpression;
 import javax.servlet.RequestDispatcher;
@@ -44,7 +45,6 @@ import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.JspFactory;
 import javax.servlet.jsp.JspWriter;
 import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.el.ELException;
 import javax.servlet.jsp.tagext.BodyContent;
 
 import org.apache.jasper.compiler.Localizer;
@@ -832,6 +832,7 @@ public class PageContextImpl extends Pag
 
     }
 
+    @SuppressWarnings("deprecation") // Still jave to support old JSP EL
     private void doHandlePageException(Throwable t) throws IOException,
             ServletException {
 
@@ -887,10 +888,9 @@ public class PageContextImpl extends Pag
                 throw (RuntimeException) t;
 
             Throwable rootCause = null;
-            if (t instanceof JspException) {
-                rootCause = ((JspException) t).getCause();
-            } else if (t instanceof ELException) {
-                rootCause = ((ELException) t).getCause();
+            if (t instanceof JspException || t instanceof ELException ||
+                    t instanceof javax.servlet.jsp.el.ELException) {
+                rootCause =t.getCause();
             }
 
             if (rootCause != null) {



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


Re: svn commit: r1406156 - /tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java

Posted by Mark Thomas <ma...@apache.org>.
On 06/11/2012 16:15, Konstantin Kolinko wrote:
> 2012/11/6  <ma...@apache.org>:
>> Author: markt
>> Date: Tue Nov  6 14:52:00 2012
>> New Revision: 1406156
>>
>> URL: http://svn.apache.org/viewvc?rev=1406156&view=rev
>> Log:
>> Fix where possible and silence where not possible some deprecation warnings
>>
>> Modified:
>>     tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
>>
>> Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
>> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1406156&r1=1406155&r2=1406156&view=diff
>> ==============================================================================
>> --- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
>> +++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Tue Nov  6 14:52:00 2012
>> @@ -28,6 +28,7 @@ import java.util.Enumeration;
>>  import java.util.HashMap;
>>
>>  import javax.el.ELContext;
>> +import javax.el.ELException;
>>  import javax.el.ExpressionFactory;
>>  import javax.el.ValueExpression;
>>  import javax.servlet.RequestDispatcher;
>> @@ -44,7 +45,6 @@ import javax.servlet.jsp.JspException;
>>  import javax.servlet.jsp.JspFactory;
>>  import javax.servlet.jsp.JspWriter;
>>  import javax.servlet.jsp.PageContext;
>> -import javax.servlet.jsp.el.ELException;
>>  import javax.servlet.jsp.tagext.BodyContent;
>>
> 
> Just noting that this change of imports  results in change in the type
> of ELException that is thrown by the "proprietaryEvaluate()" method in
> this class, because it will use a different exception now.
> 
> Just highlighting it in case if it needs more review and as this
> change is not clear from the commit message. From the first look at
> it, the change looks OK.

Yes, that was intentional. I think it is OK too.

> BTW, there are "XXX" comments on this
> PageContextImpl#proprietaryEvaluate() method and in
> o.a.jasper.compiler.JspUtil#interpreterCall(..) where it generates JSP
> java code that calls this method.
> 
> The comments say that the intention was to remove this
> "proprietaryEvaluate()" method.

I'm not sure how feasible that is, particularly given that special
handling is required when a security manager is used.

As always, thanks for the review.

Mark


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


Re: svn commit: r1406156 - /tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java

Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/11/6  <ma...@apache.org>:
> Author: markt
> Date: Tue Nov  6 14:52:00 2012
> New Revision: 1406156
>
> URL: http://svn.apache.org/viewvc?rev=1406156&view=rev
> Log:
> Fix where possible and silence where not possible some deprecation warnings
>
> Modified:
>     tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
>
> Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
> URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1406156&r1=1406155&r2=1406156&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
> +++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Tue Nov  6 14:52:00 2012
> @@ -28,6 +28,7 @@ import java.util.Enumeration;
>  import java.util.HashMap;
>
>  import javax.el.ELContext;
> +import javax.el.ELException;
>  import javax.el.ExpressionFactory;
>  import javax.el.ValueExpression;
>  import javax.servlet.RequestDispatcher;
> @@ -44,7 +45,6 @@ import javax.servlet.jsp.JspException;
>  import javax.servlet.jsp.JspFactory;
>  import javax.servlet.jsp.JspWriter;
>  import javax.servlet.jsp.PageContext;
> -import javax.servlet.jsp.el.ELException;
>  import javax.servlet.jsp.tagext.BodyContent;
>

Just noting that this change of imports  results in change in the type
of ELException that is thrown by the "proprietaryEvaluate()" method in
this class, because it will use a different exception now.

Just highlighting it in case if it needs more review and as this
change is not clear from the commit message. From the first look at
it, the change looks OK.

BTW, there are "XXX" comments on this
PageContextImpl#proprietaryEvaluate() method and in
o.a.jasper.compiler.JspUtil#interpreterCall(..) where it generates JSP
java code that calls this method.

The comments say that the intention was to remove this
"proprietaryEvaluate()" method.


Best regards,
Konstantin Kolinko

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