kinman 2002/07/18 18:13:47 Modified: jasper2/src/share/org/apache/jasper/compiler Compiler.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Fixed 10766: <%@ page extends %> causes ClassCastException Revision Changes Path 1.21 +16 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Compiler.java 16 Jul 2002 23:40:06 -0000 1.20 +++ Compiler.java 19 Jul 2002 01:13:46 -0000 1.21 @@ -63,8 +63,9 @@ import java.util.*; import java.io.*; import java.net.URL; -import javax.servlet.jsp.tagext.TagInfo; +import javax.servlet.Servlet; import javax.servlet.ServletException; +import javax.servlet.jsp.tagext.TagInfo; import org.xml.sax.Attributes; @@ -386,7 +387,7 @@ if( jsw==null ) { return false; } - HttpJspBase servlet=null; + Servlet servlet=null; try { servlet = jsw.getServlet(); } catch( ServletException ex1 ) { @@ -396,7 +397,16 @@ // System.out.println("Compiler: outdated, no servlet " + targetFile ); return true; } - List includes = servlet.getIncludes(); + + List includes = null; + // If the page contains a page directive with "extends" attribute + // it may not be an instance of HttpJspBase. + // For now only track dependencies on included files if this is not + // the case. A more complete solution is to generate the servlet + // to implement (say) JspInlcudes which contains getIncludes method. + if (servlet instanceof HttpJspBase) { + includes = ((HttpJspBase)servlet).getIncludes(); + } if (includes == null) { return false; } 1.7 +5 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JspServletWrapper.java 24 Jun 2002 22:13:08 -0000 1.6 +++ JspServletWrapper.java 19 Jul 2002 01:13:46 -0000 1.7 @@ -129,7 +129,7 @@ return ctxt; } - public HttpJspBase getServlet() + public Servlet getServlet() throws ServletException, IOException, FileNotFoundException { if (ctxt.isReload()) { @@ -153,7 +153,7 @@ } } } - return (HttpJspBase)theServlet; + return theServlet; } public ServletContext getServletContext() {
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>