luehe       2002/09/17 13:21:25

  Modified:    jasper2/src/share/org/apache/jasper/compiler Validator.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties messages_es.properties
                        messages_ja.properties
  Log:
  Fixed 12717: No Translation error thrown when an attribute that does
               not take in a rtexprvalue is given a EL as a value
  
  Revision  Changes    Path
  1.37      +23 -3     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- Validator.java    15 Sep 2002 19:12:44 -0000      1.36
  +++ Validator.java    17 Sep 2002 20:21:25 -0000      1.37
  @@ -729,6 +729,13 @@
                                       tldAttrs[j].getTypeName() );
                               }
                        } else {
  +                         // Attribute does not accept any expressions.
  +                         // Make sure its value does not contain any.
  +                         if (isExpression(n, attrs.getValue(i))) {
  +                                err.jspError(n,
  +                                     "jsp.error.attribute.non_rt_with_expr",
  +                                          tldAttrs[j].getName());
  +                         }
                            jspAttrs[i]
                                = new Node.JspAttribute(attrs.getQName(i),
                                                        attrs.getURI(i),
  @@ -934,6 +941,19 @@
   
               return result;
           }
  +
  +     /*
  +      * Checks to see if the given attribute value represents a runtime or
  +      * EL expression.
  +      */
  +     private boolean isExpression(Node.CustomTag n, String value) {
  +         if ((n.isXmlSyntax() && value.startsWith("%="))
  +                 || (!n.isXmlSyntax() && value.startsWith("<%="))
  +                 || (value.indexOf("${") != -1 && pageInfo.isELEnabled()))
  +             return true;
  +         else
  +             return false;
  +     }
   
        public void visit(Node.InvokeAction n) throws JasperException {
   
  
  
  
  1.41      +2 -2      
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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- messages.properties       15 Sep 2002 19:12:44 -0000      1.40
  +++ messages.properties       17 Sep 2002 20:21:25 -0000      1.41
  @@ -302,4 +302,4 @@
   jsp.error.badaction=The action is not a recognizable standard action.
   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
  
  
  
  1.13      +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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- messages_es.properties    15 Sep 2002 19:12:44 -0000      1.12
  +++ messages_es.properties    17 Sep 2002 20:21:25 -0000      1.13
  @@ -221,3 +221,4 @@
   jsp.error.jspelement.missing.name=
   jsp.error.tagdirective.badbodycontent=
   jsp.error.page.pageencoding.conflict=
  +jsp.error.attribute.non_rt_with_expr=
  
  
  
  1.12      +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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- messages_ja.properties    15 Sep 2002 19:12:44 -0000      1.11
  +++ messages_ja.properties    17 Sep 2002 20:21:25 -0000      1.12
  @@ -253,3 +253,4 @@
   jsp.error.jspelement.missing.name=
   jsp.error.tagdirective.badbodycontent=
   jsp.error.page.pageencoding.conflict=
  +jsp.error.attribute.non_rt_with_expr=
  
  
  

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

Reply via email to