remm        2002/10/22 04:17:56

  Modified:    jasper2/src/share/org/apache/jasper/servlet Tag:
                        tomcat_4_branch JspServlet.java
  Log:
  - Port patch.
  - Fix bug 13843 (locking of big JSP files).
  - Patch submitted by cmarton at calendra.com.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.12.2.1  +10 -4     
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.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- JspServlet.java   7 May 2002 03:15:53 -0000       1.12
  +++ JspServlet.java   22 Oct 2002 11:17:56 -0000      1.12.2.1
  @@ -67,6 +67,7 @@
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   
  +import java.io.InputStream;
   import java.io.IOException;
   import java.io.FileNotFoundException;
   import java.net.URL;
  @@ -271,9 +272,14 @@
           if (wrapper == null) {
               // First check if the requested JSP page exists, to avoid
               // creating unnecessary directories and files.
  -            if (context.getResourceAsStream(jspUri) == null) {
  +            InputStream resourceStream = context.getResourceAsStream(jspUri);
  +            if (resourceStream == null) {
                   response.sendError(HttpServletResponse.SC_NOT_FOUND, jspUri);
                   return;
  +            } else {
  +                try {
  +                    resourceStream.close();
  +                } catch(IOException e) { /* ignore */ }
               }
               boolean isErrorPage = exception != null;
               synchronized(this) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@;jakarta.apache.org>

Reply via email to