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
Date Tue, 05 Dec 2000 12:23:58 GMT
pierred     00/12/05 04:23:53

  Modified:    jasper/src/share/org/apache/jasper/compiler
                        JspParseEventListener.java
  Log:
  Ooops... last fix broke tag libraries handling (was only processed
  for XML syntax). Things now back to normal.
  
  Revision  Changes    Path
  1.15      +32 -14    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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JspParseEventListener.java	2000/12/05 11:05:19	1.14
  +++ JspParseEventListener.java	2000/12/05 12:23:46	1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.14 2000/12/05 11:05:19 pierred Exp $
  - * $Revision: 1.14 $
  - * $Date: 2000/12/05 11:05:19 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.15 2000/12/05 12:23:46 pierred Exp $
  + * $Revision: 1.15 $
  + * $Date: 2000/12/05 12:23:46 $
    *
    * ====================================================================
    *
  @@ -742,6 +742,12 @@
               throw new CompileException(start, Constants.getString(
   	    				"jsp.error.page.bad_b_and_a_combo"));
   
  +	if (directive.equals("taglib")) {
  +	    String uri = attrs.getValue("uri");
  +	    String prefix = attrs.getValue("prefix");
  +            processTaglibDirective(uri, prefix);
  +        }
  +
   	if (directive.equals("include")) {
   	    String file = attrs.getValue("file");
   	    String encoding = attrs.getValue("encoding");
  @@ -1041,20 +1047,12 @@
   		String prefix = qName.substring(6);
   		if (!prefix.equals("jsp")) {
   		    String uri = attrs.getValue(i);
  -		    System.out.println("prefix: " + prefix);
  -		    System.out.println("uri: " + uri);
  +		    //System.out.println("prefix: " + prefix);
  +		    //System.out.println("uri: " + uri);
   		    if (uri.startsWith("urn:jsptld:")) {
   			uri = uri.substring(11);
  -		    }
  -		    TagLibraryInfo tl = null;
  -		    String[] location = 
  -			ctxt.getTldLocation(uri);
  -		    if (location == null) {
  -			tl = new TagLibraryInfoImpl(ctxt, prefix, uri);
  -		    } else {
  -			tl = new TagLibraryInfoImpl(ctxt, prefix, uri, location);
   		    }
  -		    libraries.addTagLibrary(prefix, tl);
  +		    processTaglibDirective(uri, prefix);
   		}
   	    }
           }
  @@ -1109,5 +1107,25 @@
   			new Object[]{tli.getShortName(), msg}));
               }
           }
  +    }
  +
  +    /**
  +     * Process a taglib directive. This can happen either via the
  +     * JSP taglib directive (in JSP syntax) or via xmlns in <jsp:root>
  +     * (in XML syntax).
  +     */
  +    private void processTaglibDirective(String uri, String prefix)
  +	throws JasperException
  +    {
  +	TagLibraryInfo tl = null;
  +	
  +	String[] location = 
  +	    ctxt.getTldLocation(uri);
  +	if (location == null) {
  +	    tl = new TagLibraryInfoImpl(ctxt, prefix, uri);
  +	} else {
  +	    tl = new TagLibraryInfoImpl(ctxt, prefix, uri, location);
  +	}
  +	libraries.addTagLibrary(prefix, tl);
       }
   }
  
  
  

Mime
View raw message