tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServlet.java
Date Mon, 29 Apr 2002 22:39:47 GMT
remm        02/04/29 15:39:47

  Modified:    jasper2/src/share/org/apache/jasper
                        EmbededServletOptions.java JspC.java Options.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties
               jasper2/src/share/org/apache/jasper/servlet JspServlet.java
  Log:
  - Add the possibility to disable JSP reloading check. JSP reloading can still be done
    by reloading the web application, using for example the manager in Catalina.
  - This could be a useful feature in production environment, and is considerably simpler
    than optimizing the reloading check.
  
  Revision  Changes    Path
  1.2       +23 -2     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java
  
  Index: EmbededServletOptions.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EmbededServletOptions.java	28 Mar 2002 18:46:15 -0000	1.1
  +++ EmbededServletOptions.java	29 Apr 2002 22:39:46 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v
1.1 2002/03/28 18:46:15 kinman Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/28 18:46:15 $
  + * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v
1.2 2002/04/29 22:39:46 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/29 22:39:46 $
    *
    * ====================================================================
    * 
  @@ -111,6 +111,11 @@
       public boolean classDebugInfo = false;
   
       /**
  +     * JSP reloading check ?
  +     */
  +    public boolean reloading = true;
  +
  +    /**
        * I want to see my generated servlets. Which directory are they
        * in?
        */
  @@ -185,6 +190,13 @@
       }
   
       /**
  +     * JSP reloading check ?
  +     */
  +    public boolean getReloading() {
  +        return reloading;
  +    }
  +
  +    /**
        * Class ID for use in the plugin tag when the browser is IE. 
        */
       public String getIeClassId() {
  @@ -278,6 +290,15 @@
               else if (debugInfo.equalsIgnoreCase("false"))
                   this.classDebugInfo  = false;
               else Constants.message ("jsp.warning.classDebugInfo", Logger.WARNING);
  +        }
  +
  +        String reloading = config.getInitParameter("reloading");
  +        if (reloading != null) {
  +            if (reloading.equalsIgnoreCase("true"))
  +                this.reloading = true;
  +            else if (reloading.equalsIgnoreCase("false"))
  +                this.reloading = false;
  +            else Constants.message ("jsp.warning.reloading", Logger.WARNING);
           }
   
           String ieClassId = config.getInitParameter("ieClassId");
  
  
  
  1.2       +10 -3     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JspC.java	28 Mar 2002 18:46:15 -0000	1.1
  +++ JspC.java	29 Apr 2002 22:39:46 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
1.1 2002/03/28 18:46:15 kinman Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/28 18:46:15 $
  + * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
1.2 2002/04/29 22:39:46 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/29 22:39:46 $
    *
    * ====================================================================
    * 
  @@ -183,6 +183,13 @@
       public boolean getClassDebugInfo() {
           // compile with debug info
           return false;
  +    }
  +
  +    /**
  +     * JSP reloading check ?
  +     */
  +    public boolean getReloading() {
  +        return true;
       }
   
       public String getIeClassId() {
  
  
  
  1.3       +8 -3      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java
  
  Index: Options.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Options.java	24 Apr 2002 02:21:05 -0000	1.2
  +++ Options.java	29 Apr 2002 22:39:46 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
1.2 2002/04/24 02:21:05 kinman Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/04/24 02:21:05 $
  + * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
1.3 2002/04/29 22:39:46 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/29 22:39:46 $
    *
    * ====================================================================
    * 
  @@ -101,6 +101,11 @@
        * Should we include debug information in compiled class?
        */
       public boolean getClassDebugInfo();
  +
  +    /**
  +     * JSP reloading check ?
  +     */
  +    public boolean getReloading();
   
       /**
        * Class ID for use in the plugin tag when the browser is IE. 
  
  
  
  1.3       +2 -1      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- messages.properties	24 Apr 2002 11:58:00 -0000	1.2
  +++ messages.properties	29 Apr 2002 22:39:46 -0000	1.3
  @@ -1,4 +1,4 @@
  -# $Id: messages.properties,v 1.2 2002/04/24 11:58:00 remm Exp $
  +# $Id: messages.properties,v 1.3 2002/04/29 22:39:46 remm Exp $
   #
   # Default localized string information
   # Localized this the Default Locale as is en_US
  @@ -117,6 +117,7 @@
   jsp.warning.mappedFile=Warning: Invalid value for the initParam mappedFile. Will use the
default value of \"false\"
   jsp.warning.sendErrToClient=Warning: Invalid value for the initParam sendErrToClient. Will
use the default value of \"false\"
   jsp.warning.classDebugInfo=Warning: Invalid value for the initParam classdebuginfo. Will
use the default value of \"false\"
  +jsp.warning.reloading=Warning: Invalid value for the initParam reloading. Will use the
default value of \"true\"
   jsp.error.badtaglib=Unable to open taglibrary {0} : {1}
   jsp.error.badGetReader=Cannot create a reader when the stream is not buffered
   jsp.warning.unknown.element.in.TLD=Warning: Unknown element {0} in TLD
  
  
  
  1.6       +12 -9     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java
  
  Index: JspServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JspServlet.java	24 Apr 2002 23:49:05 -0000	1.5
  +++ JspServlet.java	29 Apr 2002 22:39:46 -0000	1.6
  @@ -595,16 +595,19 @@
                    req, res);
           }
           JspCompilationContext ctxt = jsw.ctxt;
  -	boolean outDated; 
  +	boolean outDated = false; 
           Compiler compiler = ctxt.createCompiler();
           
           try {
  -	    synchronized(jsw) {
  -		// Synchronizing on jsw enables simultaneous compilations of
  -		// different pages, but not the same page.
  -		outDated = compiler.isOutDated();
  -		if (outDated)
  -		    compiler.compile();
  +            if (options.getReloading()) {
  +                synchronized (jsw) {
  +                    // Synchronizing on jsw enables simultaneous 
  +                    // compilations of different pages, but not the 
  +                    // same page.
  +                    outDated = compiler.isOutDated();
  +                    if (outDated)
  +                        compiler.compile();
  +                }
               }
           } catch (FileNotFoundException ex) {
               compiler.removeGeneratedFiles();
  @@ -612,8 +615,8 @@
           } catch (JasperException ex) {
               throw ex;
           } catch (Exception ex) {
  -	    throw new JasperException(Constants.getString("jsp.error.unable.compile"),
  -                                      ex);
  +	    throw new JasperException
  +                (Constants.getString("jsp.error.unable.compile"), ex);
   	}
   
           // Reload only if it's outdated
  
  
  

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