luehe       2002/12/13 08:27:43

  Modified:    jasper2/src/share/org/apache/jasper/compiler Validator.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties
  Log:
  Fixed 15355: If a jsp:params element (nested within a jsp:plugin
  element) has no nested jsp:param elements, a translation error is not
  generated.
  
  Revision  Changes    Path
  1.60      +19 -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.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- Validator.java    13 Dec 2002 15:55:34 -0000      1.59
  +++ Validator.java    13 Dec 2002 16:27:43 -0000      1.60
  @@ -486,6 +486,22 @@
               visitBody(n);
        }
   
  +     public void visit(Node.ParamsAction n) throws JasperException {
  +         // Make sure we've got at least one nested jsp:param
  +            Node.Nodes subElems = n.getBody();
  +            if (subElems == null) {
  +             err.jspError(n, "jsp.error.params.emptyBody");
  +         }
  +         for (int i=0; i<subElems.size(); i++) {
  +             Node subElem = subElems.getNode(i);
  +             if (!(subElem instanceof Node.ParamAction)) {
  +                 err.jspError(n, "jsp.error.params.illegalChild");
  +                }
  +            }
  +
  +            visitBody(n);
  +     }
  +
        public void visit(Node.IncludeAction n) throws JasperException {
               JspUtil.checkAttributes("Include action", n,
                                       includeActionAttrs, err);
  
  
  
  1.71      +5 -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.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- messages.properties       12 Dec 2002 22:57:43 -0000      1.70
  +++ messages.properties       13 Dec 2002 16:27:43 -0000      1.71
  @@ -104,9 +104,12 @@
   jsp.error.overflow=Error: JSP Buffer overflow
   jsp.error.paramexpected=Expected \"param\" tag with \"name\" and \"value\" 
attributes
   jsp.error.param.invalidUse=The jsp:param action must not be used outside the 
jsp:include, jsp:forward, or jsp:params elements
  -jsp.error.params.invalidUse=The jsp:params action must be a direct child of 
jsp:plugin
  +jsp.error.params.invalidUse=jsp:params must be a direct child of jsp:plugin
  +jsp.error.fallback.invalidUse=jsp:fallback must be a direct child of jsp:plugin
   jsp.error.closeindividualparam=param tag needs to be closed with \"/>\"
   jsp.error.closeparams=param tag needs to be closed with /params
  +jsp.error.params.emptyBody=jsp:params must contain at least one nested jsp:param
  +jsp.error.params.illegalChild=jsp:params must not have any nested elements other 
than jsp:param
   jsp.error.plugin.notype=type not declared in jsp:plugin
   jsp.error.plugin.badtype=Illegal value for 'type' attribute in jsp:plugin: must be 
'bean' or 'applet'
   jsp.error.plugin.nocode=code not declared in jsp:plugin
  
  
  

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

Reply via email to