kinman      2002/08/29 16:27:36

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        JspDocumentParser.java Parser.java
                        ParserController.java TagFileProcessor.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties
  Log:
  - More treaking on isTagFile to make sure it works for included files.
  
  Revision  Changes    Path
  1.18      +4 -4      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java
  
  Index: JspDocumentParser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JspDocumentParser.java    28 Aug 2002 23:00:19 -0000      1.17
  +++ JspDocumentParser.java    29 Aug 2002 23:27:36 -0000      1.18
  @@ -223,7 +223,7 @@
            node = new Node.IncludeDirective(attrsCopy, start, current);
            String file = attrsCopy.getValue("file");
            try {
  -             parserController.parse(file, node, false);
  +             parserController.parse(file, node);
            } catch (FileNotFoundException fnfe) {
                throw new SAXParseException(
                       err.getString("jsp.error.file.not.found", file),
  
  
  
  1.27      +4 -4      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Parser.java       28 Aug 2002 23:00:19 -0000      1.26
  +++ Parser.java       29 Aug 2002 23:27:36 -0000      1.27
  @@ -330,7 +330,7 @@
        }
   
        try {
  -         parserController.parse(file, parent, false);
  +         parserController.parse(file, parent);
        } catch (FileNotFoundException ex) {
            err.jspError(start, "jsp.error.file.not.found", file);
        } catch (Exception ex) {
  
  
  
  1.18      +28 -9     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ParserController.java     29 Aug 2002 18:31:20 -0000      1.17
  +++ ParserController.java     29 Aug 2002 23:27:36 -0000      1.18
  @@ -151,14 +151,38 @@
       // Parse
   
       /**
  -     * Parse the jsp page provided as an argument.
  -     * This is only invoked by the compiler.
  +     * Parses a jsp file.  This is invoked by the compiler.
        *
        * @param inFileName The name of the JSP file to be parsed.
        */
       public Node.Nodes parse(String inFileName)
                throws FileNotFoundException, JasperException, IOException {
  -     return parse(inFileName, null, ctxt.isTagFile());
  +     isTagFile = ctxt.isTagFile();
  +     return parseFile(inFileName, null);
  +    }
  +
  +    /**
  +     * Parses a jsp file.  This is invoked to process an include file.
  +     *
  +     * @param inFileName The name of the JSP file to be parsed.
  +     * @param parent The node for the 'include' directive.
  +     */
  +    public Node.Nodes parse(String inFileName, Node parent)
  +             throws FileNotFoundException, JasperException, IOException {
  +     return parseFile(inFileName, parent);
  +    }
  +
  +    /**
  +     * Parses a tag file.  This is invoked by the compiler to extract tag
  +     * file directive information.
  +     *
  +     * @param inFileName The name of the tag file to be parsed.
  +     */
  +    public Node.Nodes parseTagFile(String inFileName)
  +             throws FileNotFoundException, JasperException, IOException {
  +     isTagFile = true;
  +     isTopFile = true;
  +     return parseFile(inFileName, null);
       }
   
       /**
  @@ -166,19 +190,14 @@
        * This is invoked recursively to handle 'include' directives.
        *
        * @param inFileName The name of the jsp file to be parsed.
  -     * @param parent The node for the 'include' directive.
        */
  -    public Node.Nodes parse(String inFileName, Node parent, boolean isTagFile)
  +    private Node.Nodes parseFile(String inFileName, Node parent)
                throws FileNotFoundException, JasperException, IOException {
   
  -     this.isTagFile = isTagFile;
        Node.Nodes parsedPage = null;
        String encoding = topFileEncoding;
           InputStreamReader reader = null;
        String absFileName = resolveFileName(inFileName);
  -     if (isTagFile) {
  -         isTopFile = true;
  -     }
   
        JarFile jarFile = (JarFile) ctxt.getTagFileJars().get(inFileName);
   
  
  
  
  1.20      +3 -3      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java
  
  Index: TagFileProcessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- TagFileProcessor.java     28 Aug 2002 23:00:19 -0000      1.19
  +++ TagFileProcessor.java     29 Aug 2002 23:27:36 -0000      1.20
  @@ -312,7 +312,7 @@
   
           Node.Nodes page = null;
        try {
  -         page = pc.parse(tagfile, null, true);
  +         page = pc.parseTagFile(tagfile);
        } catch (FileNotFoundException e) {
            pc.getCompiler().getErrorDispatcher().jspError(
                                           "jsp.error.file.not.found", tagfile);
  
  
  
  1.35      +3 -1      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- messages.properties       25 Aug 2002 21:35:23 -0000      1.34
  +++ messages.properties       29 Aug 2002 23:27:36 -0000      1.35
  @@ -299,3 +299,5 @@
   jsp.error.could.not.add.taglibraries=Could not add tag one or more libraries.
   jsp.error.duplicate.name.jspattribute=The attribute {0} specified in the standard 
or custom action also appears as the value of the name attribute in the enclosed 
jsp:attribute
   jsp.error.not.in.template=Not allowed in a template text body.
  +jsp.error.badaction=The action is not a recognizable standard action.
  +
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to