kinman      2002/09/04 10:59:11

  Modified:    jasper2/src/share/org/apache/jasper/compiler Parser.java
                        TagFileProcessor.java
  Log:
  - Fix 12269: accepts lower case body content types.
  
  Revision  Changes    Path
  1.28      +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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Parser.java       29 Aug 2002 23:27:36 -0000      1.27
  +++ Parser.java       4 Sep 2002 17:59:11 -0000       1.28
  @@ -1498,10 +1498,10 @@
               err.jspError( reader.mark(), "jsp.error.not.in.template" );
           } else if (reader.matches("<%")) {
               err.jspError( reader.mark(), "jsp.error.not.in.template" );
  -            err.jspError( reader.mark(), "jsp.error.not.in.template" );
           } else if (reader.matches("<jsp:scriptlet")) {
               err.jspError( reader.mark(), "jsp.error.not.in.template" );
           } else if (reader.matches("<jsp:text")) {
  +            err.jspError( reader.mark(), "jsp.error.not.in.template" );
           } else if (reader.matches("${")) {
               err.jspError( reader.mark(), "jsp.error.not.in.template" );
           } else if (reader.matches("<jsp:")) {
  
  
  
  1.22      +25 -19    
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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- TagFileProcessor.java     4 Sep 2002 17:27:10 -0000       1.21
  +++ TagFileProcessor.java     4 Sep 2002 17:59:11 -0000       1.22
  @@ -74,7 +74,8 @@
   import org.apache.jasper.servlet.JspServletWrapper;
   
   /**
  - * Processes and extracts the directive info in a tag file.
  + * 1. Processes and extracts the directive info in a tag file.
  + * 2. Compiles and loads tag files used in a JSP file.
    *
    * @author Kin-man Chung
    */
  @@ -158,9 +159,9 @@
   
               bodycontent = n.getAttributeValue("body-content");
               if (bodycontent != null &&
  -                    !bodycontent.equals(TagInfo.BODY_CONTENT_EMPTY) &&
  -                    !bodycontent.equals(TagInfo.BODY_CONTENT_TAG_DEPENDENT) &&
  -                    !bodycontent.equals(TagInfo.BODY_CONTENT_SCRIPTLESS)) {
  +                    !bodycontent.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY) &&
  +                    
!bodycontent.equalsIgnoreCase(TagInfo.BODY_CONTENT_TAG_DEPENDENT) &&
  +                    !bodycontent.equalsIgnoreCase(TagInfo.BODY_CONTENT_SCRIPTLESS)) 
{
                   err.jspError("jsp.error.tagdirective.badbodycontent",
                                bodycontent);
               }
  @@ -331,7 +332,7 @@
       /**
        * Compiles and loads a tagfile.
        */
  -    public static Class loadTagFile(JspCompilationContext ctxt,
  +    private static Class loadTagFile(JspCompilationContext ctxt,
                                    String tagFilePath, TagInfo tagInfo,
                                    TagData tagData)
        throws JasperException {
  @@ -339,19 +340,18 @@
        JspRuntimeContext rctxt = ctxt.getRuntimeContext();
           JspServletWrapper wrapper =
                (JspServletWrapper) rctxt.getWrapper(tagFilePath);
  +
  +     // No need to synchronize wrapper creation since this can only
  +     // happen when a JSP file is compiled, which is synchronized.
        if (wrapper == null) {
  -         synchronized(rctxt) {
  -             wrapper = (JspServletWrapper) rctxt.getWrapper(tagFilePath);
  -             if (wrapper == null) {
  -                 wrapper = new JspServletWrapper(ctxt.getServletContext(),
  -                                                 ctxt.getOptions(),
  -                                                 tagFilePath,
  -                                                    tagInfo,
  -                                                 tagData,
  -                                                 ctxt.getRuntimeContext(),
  -                                                 ctxt.getTagFileJars());
  -             }
  -         }
  +         wrapper = new JspServletWrapper(ctxt.getServletContext(),
  +                                         ctxt.getOptions(),
  +                                         tagFilePath,
  +                                         tagInfo,
  +                                         tagData,
  +                                         ctxt.getRuntimeContext(),
  +                                         ctxt.getTagFileJars());
  +         rctxt.addWrapper(tagFilePath,wrapper);
        }
        return wrapper.loadTagFile();
       }
  @@ -384,6 +384,12 @@
        }
       }
   
  +    /**
  +     * Implements a phase of the translation that compiles (if necessary)
  +     * the tag files used in a JSP files.  The directives in the tag files
  +     * are assumed to have been proccessed and encapsulated as TagFileInfo
  +     * in the CustomTag nodes.
  +     */
       public static void loadTagFiles(Compiler compiler, Node.Nodes page)
                throws JasperException {
   
  
  
  

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

Reply via email to