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 Validator.java
Date Sun, 25 Aug 2002 21:49:55 GMT
kinman      2002/08/25 14:49:55

  Modified:    jasper2/src/share/org/apache/jasper/compiler Validator.java
  Log:
  - Complete Mark Roth's patch.
  
  Revision  Changes    Path
  1.31      +43 -3     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Validator.java	24 Aug 2002 21:42:34 -0000	1.30
  +++ Validator.java	25 Aug 2002 21:49:55 -0000	1.31
  @@ -275,6 +275,46 @@
               // tag file in which the directive appeared.
           
               // This method does additional processing to collect page info
  +            
  +	    Attributes attrs = n.getAttributes();
  +	    for (int i = 0; i < attrs.getLength(); i++) {
  +		String attr = attrs.getQName(i);
  +		String value = attrs.getValue(i);
  +
  +		if ("language".equals(attr)) {
  +		    if (languageSeen)
  +			err.jspError(n, "jsp.error.page.multiple.language");
  +		    languageSeen = true;
  +		    if (!"java".equalsIgnoreCase(value))
  +			err.jspError(n, "jsp.error.language.nonjava");
  +		    pageInfo.setLanguage(value);
  +		} else if ("isScriptingEnabled".equals(attr)) {
  +		    // XXX Test for multiple occurrence?
  +		    if ("true".equalsIgnoreCase(value))
  +			pageInfo.setScriptingEnabled(true);
  +		    else if ("false".equalsIgnoreCase(value))
  +			pageInfo.setScriptingEnabled(false);
  +		    else
  +			err.jspError(n, "jsp.error.isScriptingEnabled.invalid");
  +		} else if ("isELEnabled".equals(attr)) {
  +		    // XXX Test for multiple occurrence?
  +		    if ("true".equalsIgnoreCase(value))
  +			pageInfo.setELEnabled(true);
  +		    else if ("false".equalsIgnoreCase(value))
  +			pageInfo.setELEnabled(false);
  +		    else
  +			err.jspError(n, "jsp.error.isELEnabled.invalid");
  +		} else if ("pageEncoding".equals(attr)) {
  +		    if (pageEncodingSeen) 
  +			err.jspError(n, "jsp.error.page.multiple.pageencoding");
  +		    pageEncodingSeen = true;
  +		    pageInfo.setPageEncoding(value);
  +		}
  +	    }
  +
  +	    // Attributes for imports for this node have been processed by
  +	    // the parsers, just add them to pageInfo.
  +	    pageInfo.addImports(n.getImports());
   	}
   
   	public void visit(Node.AttributeDirective n) throws JasperException {
  
  
  

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