luehe       2002/10/16 16:23:53

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        PageDataImpl.java
  Log:
  Fixed 4764102: XML view of jsp page contains jsp:root elements nested
  in other jsp:root element
  
  Revision  Changes    Path
  1.8       +15 -7     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java
  
  Index: PageDataImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/PageDataImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PageDataImpl.java 16 Oct 2002 20:15:32 -0000      1.7
  +++ PageDataImpl.java 16 Oct 2002 23:23:53 -0000      1.8
  @@ -175,7 +175,10 @@
   
        public void visit(Node.Root n) throws JasperException {
            visitBody(n);
  -         root.setAttributes(rootAttrs);
  +         if (n == this.root) {
  +             // top-level page
  +             this.root.setAttributes(rootAttrs);
  +         }
        }
   
        public void visit(Node.JspRoot n) throws JasperException {
  @@ -199,7 +202,7 @@
            visitBody(n);
            if (n == this.root) {
                // top-level jsp:root element
  -             root.setAttributes(rootAttrs);
  +             this.root.setAttributes(rootAttrs);
            }
        }
   
  @@ -211,7 +214,7 @@
            if (attrs != null) {
                String location = attrs.getValue("uri");
                if (location == null) {
  -                 // JSP 2.0 CLARIFICATION NEEDED
  +                 // XXX JSP 2.0 CLARIFICATION NEEDED
                    location = attrs.getValue("tagdir");
                }
                String prefix = attrs.getValue("prefix");
  @@ -247,7 +250,12 @@
         * Visits root node of JSP page in JSP syntax.
         */
        public void visit(Node.Root n) throws JasperException {
  -         appendTag(JSP_ROOT, n.getAttributes(), n.getBody());
  +         if (n == this.root) {
  +             // top-level page
  +             appendTag(JSP_ROOT, n.getAttributes(), n.getBody());
  +         } else {
  +             visitBody(n);
  +         }
        }
   
        /*
  
  
  

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

Reply via email to