tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kin...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler ParserController.java
Date Wed, 21 Aug 2002 00:45:01 GMT
kinman      2002/08/20 17:45:00

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        ParserController.java
  Log:
  - Minor treak to get isTagFile and Encoding right.
  
  Revision  Changes    Path
  1.14      +10 -12    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java
  
  Index: ParserController.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ParserController.java	20 Aug 2002 23:35:30 -0000	1.13
  +++ ParserController.java	21 Aug 2002 00:45:00 -0000	1.14
  @@ -236,6 +236,13 @@
   				      InputStreamReader reader)
   	 throws JasperException
       {
  +	newEncoding = null;
  +
  +	// FIXME: Actually we should know that we are compiling a tag file
  +	// if we begin the compilation from either the tag file
  +	// element in a tld OR tagdir attribute in a tag directive.
  +        isTagFile = file.startsWith( "/WEB-INF/tags" ) ||
  +                    file.startsWith( "/META-INF/tags" );
   
   	PageInfo pageInfo = compiler.getPageInfo();
   	if (pageInfo.isXmlSpecified()) {
  @@ -244,7 +251,7 @@
   	if (pageInfo.getPageEncoding() != null) {
   	    newEncoding = pageInfo.getPageEncoding();
   	}
  -	if (pageInfo.isXmlSpecified() && pageInfo.getPageEncoding() != null)
  +	if (pageInfo.isXmlSpecified() && newEncoding != null)
   	    return;
   
   	JspReader jspReader;
  @@ -270,24 +277,15 @@
   	    }
   	}
   
  -	if (pageInfo.getPageEncoding() != null) {
  -	    // XXX isTagFile is not correctly set, but it will be determined
  -	    // elsewhere, and not here anyway.
  +	if (newEncoding != null) {
  +	    // encoding specified in jsp-config
   	    return;
   	}
   
  -	newEncoding = null;
  -	isTagFile = false;
  -
   	// Figure out the encoding of the page
   	// FIXME: We assume xml parser will take care of
           // encoding for page in XML syntax. Correct?
   	if (!isXml) {
  -            // Note: this currently assumes there is no XML syntax for tag 
  -            // files (as of PFD of the JSP 2.0 spec there is an XML view, 
  -            // but no XML syntax).
  -            isTagFile = file.startsWith( "/WEB-INF/tags" ) ||
  -                file.startsWith( "/META-INF/tags" );
   	    jspReader.reset(startMark);
   	    while (jspReader.skipUntil("<%@") != null) {
   		jspReader.skipSpaces();
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message