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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to