tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler Parser.java TagBeginGenerator.java TagLibraryInfoImpl.java
Date Thu, 21 Oct 1999 02:47:56 GMT
mandar      99/10/20 19:47:54

  Modified:    src/examples/WEB-INF/jsp example-taglib.tld
               src/share/org/apache/jasper Constants.java
               src/share/org/apache/jasper/compiler Parser.java
                        TagBeginGenerator.java TagLibraryInfoImpl.java
  Log:
  Bunch of fixes for custom tags. This is intermediate code and has debug output.
  
  - Mandar, Anil
  
  Revision  Changes    Path
  1.2       +2 -2      jakarta-tomcat/src/examples/WEB-INF/jsp/example-taglib.tld
  
  Index: example-taglib.tld
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/examples/WEB-INF/jsp/example-taglib.tld,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- example-taglib.tld	1999/10/20 22:08:22	1.1
  +++ example-taglib.tld	1999/10/21 02:47:49	1.2
  @@ -1,7 +1,7 @@
   <?xml version="1.0" encoding="ISO-8859-1" ?>
   <!DOCTYPE taglib
  -        PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
  -	"http://java.sun.com/j2ee/dtds/jsptaglibrary_1_2.dtd">
  +        PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
  +	"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
   
   <!-- a tab library descriptor -->
   
  
  
  
  1.6       +4 -4      jakarta-tomcat/src/share/org/apache/jasper/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Constants.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Constants.java	1999/10/20 21:20:29	1.5
  +++ Constants.java	1999/10/21 02:47:50	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Constants.java,v 1.5 1999/10/20
21:20:29 mandar Exp $
  - * $Revision: 1.5 $
  - * $Date: 1999/10/20 21:20:29 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/Constants.java,v 1.6 1999/10/21
02:47:50 mandar Exp $
  + * $Revision: 1.6 $
  + * $Date: 1999/10/21 02:47:50 $
    *
    * ====================================================================
    * 
  @@ -153,7 +153,7 @@
        * ID and location of the DTD for tag library descriptors. 
        */
       public static final String 
  -        TAGLIB_DTD_PUBLIC_ID = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
  +        TAGLIB_DTD_PUBLIC_ID = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
       public static final String
           TAGLIB_DTD_RESOURCE = "/org/apache/jasper/resources/web-jsptaglib_1_1.dtd";
   
  
  
  
  1.3       +11 -5     jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Parser.java	1999/10/20 11:22:54	1.2
  +++ Parser.java	1999/10/21 02:47:50	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java,v
1.2 1999/10/20 11:22:54 akv Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/20 11:22:54 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java,v
1.3 1999/10/21 02:47:50 mandar Exp $
  + * $Revision: 1.3 $
  + * $Date: 1999/10/21 02:47:50 $
    *
    * ====================================================================
    * 
  @@ -738,12 +738,17 @@
               Mark bodyStart = null;
               Mark bodyStop = null;
   
  -	    if (bc.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY)) {
  +	    
  +	    System.out.println("Tag: "+tag);
  +	    System.out.println("BC: "+bc);
  +	    
  +	    if (reader.matches(CLOSE_1)
  +		|| bc.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY)) {
   		if (reader.matches(CLOSE_1))
   		    reader.advance(CLOSE_1.length());
   		else
   		    throw new ParseException(start, "Body is supposed to be empty for "+tag);
  -
  +		
   		listener.handleTagBegin(start, attrs, prefix,
   					shortTagName, tli, ti);
   		listener.handleTagEnd(start, reader.mark(), prefix, 
  @@ -752,6 +757,7 @@
   		// Body can be either
   		//     - JSP tags
   		//     - tag dependent stuff
  +		System.out.println("nextChar before croaking: "+(char) reader.peekChar());
   		if (reader.matches(CLOSE)) {
   		    reader.advance(CLOSE.length());
   		    bodyStart = reader.mark();
  
  
  
  1.4       +15 -14    jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java
  
  Index: TagBeginGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TagBeginGenerator.java	1999/10/20 11:22:54	1.3
  +++ TagBeginGenerator.java	1999/10/21 02:47:51	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
1.3 1999/10/20 11:22:54 akv Exp $
  - * $Revision: 1.3 $
  - * $Date: 1999/10/20 11:22:54 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
1.4 1999/10/21 02:47:51 mandar Exp $
  + * $Revision: 1.4 $
  + * $Date: 1999/10/21 02:47:51 $
    *
    * ====================================================================
    * 
  @@ -248,18 +248,19 @@
   	writer.pushIndent();
   	
   
  -        writer.println("if ("+evalVar+" != Tag.EVAL_BODY_INCLUDE) {");
  -        writer.pushIndent();
  -
  -	writer.println("out = pageContext.pushBody();");
  -	writer.println(thVarName+".setBodyContent((BodyContent) out);");
  -
  -        writer.popIndent();
  -        writer.println("}");
  +	if (implementsBodyTag) {
  +	    writer.println("if ("+evalVar+" != Tag.EVAL_BODY_INCLUDE) {");
  +	    writer.pushIndent();
  +
  +	    writer.println("out = pageContext.pushBody();");
  +	    writer.println(thVarName+".setBodyContent((BodyContent) out);");
  +
  +	    writer.popIndent();
  +	    writer.println("}");
  +	    
  +	    writer.println(thVarName+".doInitBody();");
  +	}
           
  -        if (implementsBodyTag)
  -            writer.println(thVarName+".doInitBody();");
  -
   	writer.println("do {");
   	writer.pushIndent();
           // Need to declare and update NESTED variables here
  
  
  
  1.5       +16 -9     jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
  
  Index: TagLibraryInfoImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TagLibraryInfoImpl.java	1999/10/20 22:08:43	1.4
  +++ TagLibraryInfoImpl.java	1999/10/21 02:47:51	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.4 1999/10/20 22:08:43 akv Exp $
  - * $Revision: 1.4 $
  - * $Date: 1999/10/20 22:08:43 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.5 1999/10/21 02:47:51 mandar Exp $
  + * $Revision: 1.5 $
  + * $Date: 1999/10/21 02:47:51 $
    *
    * ====================================================================
    * 
  @@ -80,6 +80,7 @@
   import javax.servlet.jsp.tagext.TagInfo;
   import javax.servlet.jsp.tagext.TagAttributeInfo;
   import javax.servlet.jsp.tagext.TagExtraInfo;
  +import javax.servlet.http.HttpServletRequest;
   
   import org.w3c.dom.*;
   import org.xml.sax.*;
  @@ -191,12 +192,17 @@
   	    // "uri" should point to the correct tld location.
   
   	    if (!uri.startsWith("/")) {
  -		url = new URL(uri);
  -		in = url.openStream();
  -	    } else {
  -		relativeURL = true;
  -		in = ctxt.getServletContext().getResourceAsStream(uri);
  +		HttpServletRequest request = ctxt.getRequest();
  +		String actURI =  request.getServletPath();
  +		String baseURI = actURI.substring(0, actURI.lastIndexOf('/'));
  +		uri = baseURI + '/' + uri;
  +		//url = new URL(uri);
  +		//in = url.openStream();
   	    }
  +	    //else {
  +	    //relativeURL = true;
  +	    in = ctxt.getServletContext().getResourceAsStream(uri);
  +	    //}
   	    
   	    if (in == null)
   		throw new JasperException(Constants.getString("jsp.error.tld_not_found",
  @@ -357,7 +363,8 @@
   
       private TagInfo createTagInfo(Element elem) throws JasperException {
           String name = null, tagclass = null, teiclass = null;
  -        String bodycontent = null, info = null;
  +        String bodycontent = "JSP"; // Default body content is JSP
  +	String info = null;
           
           Vector attributeVector = new Vector();
           NodeList list = elem.getChildNodes();
  
  
  

Mime
View raw message