On 27/08/2014 13:34, Konstantin Kolinko wrote: > 2014-08-27 13:06 GMT+04:00 Mark Thomas <ma...@apache.org>: >> On 26/08/2014 23:16, Konstantin Kolinko wrote: >>> 2014-08-26 17:32 GMT+04:00 <ma...@apache.org>: >>>> Author: markt >>>> Date: Tue Aug 26 13:32:45 2014 >>>> New Revision: 1620596 >>>> >>>> URL: http://svn.apache.org/r1620596 >>>> Log: >>>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56568 >>>> Enable any HTTP method to be used to request a JSP page that has the >>>> isErrorPage page directive set to true. >>>> >>>> Added: >>>> tomcat/trunk/test/webapp/jsp/error.jsp (with props) >>>> Modified: >>>> tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java >>>> tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java >>>> tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java >>>> tomcat/trunk/test/org/apache/jasper/servlet/TestJspServlet.java >>>> tomcat/trunk/webapps/docs/changelog.xml >>>> Modified: tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java >>>> URL: >>>> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java?rev=1620596&r1=1620595&r2=1620596&view=diff >>>> ============================================================================== >>>> --- tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java (original) >>>> +++ tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java Tue Aug 26 >>>> 13:32:45 2014 >>>> @@ -255,6 +255,11 @@ public abstract class Compiler { >>>> // to be GC'd and save memory. >>>> ctxt.setWriter(null); >>>> >>>> + // Need to know if the JSP is an error page at runtime to >>>> determine >>>> + // which HTTP methods are permitted. Error pages permit any. >>>> Normal >>>> + // pages only permit GET, POST or HEAD. >>>> + jsw.setErrorPage(pageInfo.isErrorPage()); >>>> + >>> >>> Apparently this causes org.apache.jasper.TestJspC to fail with many NPEs, >>> as noted by Gump in tomcat-trunk-test-nio: >>> >>> [junit] java.lang.NullPointerException >>> [junit] at >>> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:261) >>> [junit] at >>> org.apache.jasper.compiler.Compiler.compile(Compiler.java:361) >>> [junit] at org.apache.jasper.JspC.processFile(JspC.java:1217) >>> >>> All other test cases completed successfully. >> >> Thanks. Fixed. > > I think that method is a wrong place to configure a JspServletWrapper.
I think you are right. I was trying fail early but I think the check is going to need to be lower - probably in the generated code. > The generateJava() method generates java text for a JSP page. It will > be skipped if there is no need to recompile the page. > E.g. if web application was reloaded and loads a previously compiled class. That is one failure mode. > I also wonder how this feature works with precompiled JSPs that are > decalred as <servlet>s in web.xml. I suspect that is another. I'll take another look. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org