tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pier...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler JspParseEventListener.java XmlOutputter.java
Date Sat, 09 Dec 2000 00:36:11 GMT
pierred     00/12/08 16:36:11

  Modified:    jasper/src/share/org/apache/jasper/compiler
                        JspParseEventListener.java XmlOutputter.java
  Log:
  Added proper handling of <jsp:include> and <jsp:forward>
  tags when generating the XML stream for validation by tag
  libraries.
  
  Revision  Changes    Path
  1.17      +9 -5      jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JspParseEventListener.java	2000/12/08 20:45:09	1.16
  +++ JspParseEventListener.java	2000/12/09 00:36:10	1.17
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.16 2000/12/08 20:45:09 pierred Exp $
  - * $Revision: 1.16 $
  - * $Date: 2000/12/08 20:45:09 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.17 2000/12/09 00:36:10 pierred Exp $
  + * $Revision: 1.17 $
  + * $Date: 2000/12/09 00:36:10 $
    *
    * ====================================================================
    *
  @@ -952,7 +952,9 @@
                   new ForwardGenerator(start, attrs, param, isXml),
                   start, stop);
   	addGenerator(gen);
  -	//@@@ xo
  +	xo.append("jsp:forward", attrs);
  +	xo.append("jsp:param", param);
  +	xo.append("jsp:forward");
       }
   
       public void handleInclude(Mark start, Mark stop, Attributes attrs, 
  @@ -971,7 +973,9 @@
                   new IncludeGenerator(start, attrs, param, isXml),
                   start, stop);
   	addGenerator(gen);
  -	//@@@ xo
  +	xo.append("jsp:include", attrs);
  +	xo.append("jsp:param", param);
  +	xo.append("jsp:include");
       }
   
       public void handleCharData(Mark start, Mark stop, char[] chars) throws JasperException
{
  
  
  
  1.6       +20 -3     jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java
  
  Index: XmlOutputter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XmlOutputter.java	2000/12/08 20:45:13	1.5
  +++ XmlOutputter.java	2000/12/09 00:36:10	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java,v
1.5 2000/12/08 20:45:13 pierred Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/12/08 20:45:13 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/XmlOutputter.java,v
1.6 2000/12/09 00:36:10 pierred Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/12/09 00:36:10 $
    *
    * ====================================================================
    *
  @@ -153,6 +153,23 @@
        */
       void append(String tag, Attributes attrs) {
           append(tag, attrs, sb);
  +    }
  +    
  +    /**
  +     * Append the start tag along with its attributes 
  +     * (name, value) to the XML stream.
  +     */
  +    void append(String tag, Hashtable table) {
  +	Enumeration enum = table.keys();
  +	while (enum.hasMoreElements()) {
  +	    String name = (String)enum.nextElement();
  +	    String value = ((String[])table.get(name))[0];
  +	    AttributesImpl attrs = new AttributesImpl();
  +	    attrs.addAttribute("", "name", "name", "CDATA", name);
  +	    attrs.addAttribute("", "value", "value", "CDATA", value);
  +	    append(tag, attrs, sb);
  +	    append(tag);
  +	}
       }
       
       /**
  
  
  

Mime
View raw message