kinman      2002/07/18 18:16:04

  Modified:    jasper2/src/share/org/apache/jasper/compiler Tag:
                        tomcat_4_branch Compiler.java
               jasper2/src/share/org/apache/jasper/servlet Tag:
                        tomcat_4_branch JspServletWrapper.java
  Log:
  - Fixed 10766: <%@ page extends %> causes ClassCastException
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.18.2.1  +14 -5     
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.18
  retrieving revision 1.18.2.1
  diff -u -r1.18 -r1.18.2.1
  --- Compiler.java     21 Jun 2002 02:28:47 -0000      1.18
  +++ Compiler.java     19 Jul 2002 01:16:04 -0000      1.18.2.1
  @@ -376,7 +376,7 @@
           if( jsw==null ) {
               return false;
           }
  -        HttpJspBase servlet=null;
  +        Servlet servlet=null;
           try {
               servlet = jsw.getServlet();
           } catch( ServletException ex1 ) {
  @@ -386,7 +386,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;
           }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.1   +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.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- JspServletWrapper.java    24 Jun 2002 22:13:08 -0000      1.6
  +++ JspServletWrapper.java    19 Jul 2002 01:16:04 -0000      1.6.2.1
  @@ -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]>

Reply via email to