luehe       2002/09/24 14:24:58

  Modified:    jasper2/src/share/org/apache/jasper/compiler Compiler.java
                        ScriptingVariabler.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties messages_es.properties
                        messages_ja.properties
  Log:
  Fixed 12657: using name-from-attribute in tld causes NullPointerException
  
  Revision  Changes    Path
  1.35      +1 -1      
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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Compiler.java     13 Sep 2002 20:35:36 -0000      1.34
  +++ Compiler.java     24 Sep 2002 21:24:58 -0000      1.35
  @@ -283,7 +283,7 @@
           long t3=System.currentTimeMillis();
           
        // Determine which custom tag needs to declare which scripting vars
  -     ScriptingVariabler.set(pageNodes);
  +     ScriptingVariabler.set(pageNodes, errDispatcher);
   
        // generate servlet .java file
        Generator.generate(writer, this, pageNodes);
  
  
  
  1.5       +16 -8     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ScriptingVariabler.java
  
  Index: ScriptingVariabler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ScriptingVariabler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ScriptingVariabler.java   9 Sep 2002 23:24:14 -0000       1.4
  +++ ScriptingVariabler.java   24 Sep 2002 21:24:58 -0000      1.5
  @@ -100,9 +100,11 @@
        */
       static class ScriptingVariableVisitor extends Node.Visitor {
   
  +     private ErrorDispatcher err;
        private Hashtable scriptVars;
  -
  -     public ScriptingVariableVisitor() {
  +     
  +     public ScriptingVariableVisitor(ErrorDispatcher err) {
  +         this.err = err;
            scriptVars = new Hashtable();
        }
   
  @@ -113,7 +115,8 @@
            setScriptingVars(n, VariableInfo.AT_END);
        }
   
  -     private void setScriptingVars(Node.CustomTag n, int scope) {
  +     private void setScriptingVars(Node.CustomTag n, int scope)
  +             throws JasperException {
   
            TagVariableInfo[] tagVarInfos = n.getTagVariableInfos();
            VariableInfo[] varInfos = n.getVariableInfos();
  @@ -162,6 +165,10 @@
                    if (varName == null) {
                        varName = n.getTagData().getAttributeString(
                                        tagVarInfos[i].getNameFromAttribute());
  +                     if (varName == null) {
  +                         err.jspError(n, 
"jsp.error.scripting.variable.missing_name",
  +                                      tagVarInfos[i].getNameFromAttribute());
  +                     }
                    }
   
                    Integer currentRange = (Integer) scriptVars.get(varName);
  @@ -177,8 +184,9 @@
        }
       }
   
  -    public static void set(Node.Nodes page) throws JasperException {
  +    public static void set(Node.Nodes page, ErrorDispatcher err)
  +         throws JasperException {
        page.visit(new CustomTagCounter());
  -     page.visit(new ScriptingVariableVisitor());
  +     page.visit(new ScriptingVariableVisitor(err));
       }
   }
  
  
  
  1.42      +2 -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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- messages.properties       17 Sep 2002 20:21:25 -0000      1.41
  +++ messages.properties       24 Sep 2002 21:24:58 -0000      1.42
  @@ -303,3 +303,4 @@
   jsp.error.tagdirective.badbodycontent=Invalid body-content ({0}) in tag directive
   jsp.error.page.pageencoding.conflict=Page-encoding specified in jsp-property-group 
({0}) is different from that specified in page directive ({1})
   jsp.error.attribute.non_rt_with_expr=According to TLD, attribute {0} does not 
accept any expressions
  +jsp.error.scripting.variable.missing_name=Unable to determine scripting variable 
name from attribute {0}
  
  
  
  1.14      +2 -1      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties
  
  Index: messages_es.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_es.properties,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- messages_es.properties    17 Sep 2002 20:21:25 -0000      1.13
  +++ messages_es.properties    24 Sep 2002 21:24:58 -0000      1.14
  @@ -222,3 +222,4 @@
   jsp.error.tagdirective.badbodycontent=
   jsp.error.page.pageencoding.conflict=
   jsp.error.attribute.non_rt_with_expr=
  +jsp.error.scripting.variable.missing_name=
  
  
  
  1.13      +2 -1      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties
  
  Index: messages_ja.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages_ja.properties,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- messages_ja.properties    17 Sep 2002 20:21:25 -0000      1.12
  +++ messages_ja.properties    24 Sep 2002 21:24:58 -0000      1.13
  @@ -254,3 +254,4 @@
   jsp.error.tagdirective.badbodycontent=
   jsp.error.page.pageencoding.conflict=
   jsp.error.attribute.non_rt_with_expr=
  +jsp.error.scripting.variable.missing_name=
  
  
  

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

Reply via email to