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/servlet JspServlet.java
Date Tue, 31 Oct 2000 22:12:22 GMT
pierred     00/10/31 14:12:21

  Modified:    jasper/src/share/org/apache/jasper/servlet JspServlet.java
  Log:
  Accept 'jsp_precompile=' so we pass watchdog test.
  
  Revision  Changes    Path
  1.5       +19 -12    jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/servlet/JspServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JspServlet.java	2000/10/09 21:47:29	1.4
  +++ JspServlet.java	2000/10/31 22:12:20	1.5
  @@ -285,6 +285,7 @@
   	    Object pd=context.getAttribute("org.apache.tomcat.protection_domain");
   	    loader.setProtectionDomain( pd );
   	}
  +
   	if (firstTime) {
   	    firstTime = false;
   	    Constants.message("jsp.message.scratch.dir.is", 
  @@ -321,21 +322,27 @@
           String qString = request.getQueryString();
           
           if (precom != null) {
  -            if (precom.equals("true")) 
  +	    // An equal sign was specified 
  +	    // (?jsp_precompile=... or &jsp_precompile=...)
  +            if (precom.equals("true") || precom.trim().length()==0) {
                   precompile = true;
  -            else if (precom.equals("false")) 
  +            } else if (precom.equals("false")) {
                   precompile = false;
  -            else {
  -		    // This is illegal.
  -		    throw new ServletException("Can't have request parameter " +
  -					       Constants.PRECOMPILE + " set to " + precom);
  -		}
  +            } else {
  +		// This is illegal.
  +		throw new ServletException("Can't have request parameter " +
  +					   Constants.PRECOMPILE + " set to " + precom);
   	    }
  -        else if (qString != null && (qString.startsWith(Constants.PRECOMPILE) ||
  -                                     qString.indexOf("&" + Constants.PRECOMPILE)
  -                                     != -1))
  -            precompile = true;
  -
  +        } else {
  +	    // Check if precompile is specified (but it does not have
  +	    // the '=' following it.)
  +	    if (qString != null && 
  +		     (qString.startsWith(Constants.PRECOMPILE) ||
  +		     qString.indexOf("&" + Constants.PRECOMPILE)
  +		     != -1)) {
  +		precompile = true;
  +	    }
  +	}
           return precompile;
       }
       
  
  
  

Mime
View raw message