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 Sat, 24 Aug 2002 00:48:22 GMT
kinman      2002/08/23 17:48:22

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        ParserController.java
  Log:
  - Recognize suffix .jspx to be a JSP document (XML)
  
  Revision  Changes    Path
  1.15      +12 -3     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ParserController.java	21 Aug 2002 00:45:00 -0000	1.14
  +++ ParserController.java	24 Aug 2002 00:48:22 -0000	1.15
  @@ -245,14 +245,23 @@
                       file.startsWith( "/META-INF/tags" );
   
   	PageInfo pageInfo = compiler.getPageInfo();
  +
  +	boolean isXmlFound = false;
   	if (pageInfo.isXmlSpecified()) {
  +	    // If <is-xml> is specified in a <jsp-property-group>, it is used.
   	    isXml = pageInfo.isXml();
  +	    isXmlFound = true;
  +	} else if (file.endsWith(".jspx")) {
  +	    isXml = true;
  +	    isXmlFound = true;
   	}
  +	
   	if (pageInfo.getPageEncoding() != null) {
   	    newEncoding = pageInfo.getPageEncoding();
   	}
  -	if (pageInfo.isXmlSpecified() && newEncoding != null)
  -	    return;
  +
  +	if (isXmlFound && newEncoding != null)
  +	    return;	// No need to scan the file
   
   	JspReader jspReader;
   	try {
  @@ -264,7 +273,7 @@
           jspReader.setSingleFile(true);
           Mark startMark = jspReader.mark();
   
  -	if (!pageInfo.isXmlSpecified()) {
  +	if (!isXmlFound) {
   	    // Check for the jsp:root tag
   	    // No check for xml prolog, since nothing prevents a page
   	    // to output XML and still use JSP syntax.
  
  
  

--
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