tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ssi ExpressionTokenizer.java SSIFlastmod.java SSIServletExternalResolver.java
Date Wed, 17 Aug 2005 21:21:37 GMT
markt       2005/08/17 14:21:37

  Modified:    catalina/src/share/org/apache/catalina/ssi
                        ExpressionTokenizer.java SSIFlastmod.java
                        SSIServletExternalResolver.java
  Log:
  Fix handling of non-file based includes with SSI
   - Patch submitted by David Becker
  
  Removed unused code in package o.a.c.ssi (Eclipse)
  
  Revision  Changes    Path
  1.3       +1 -2      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ssi/ExpressionTokenizer.java
  
  Index: ExpressionTokenizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ssi/ExpressionTokenizer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExpressionTokenizer.java	1 Sep 2004 18:33:33 -0000	1.2
  +++ ExpressionTokenizer.java	17 Aug 2005 21:21:37 -0000	1.3
  @@ -34,7 +34,6 @@
       public static final int TOKEN_LT = 11;
       public static final int TOKEN_END = 12;
       private char[] expr;
  -    private int tokenType = TOKEN_STRING;
       private String tokenVal = null;
       private int index;
       private int length;
  
  
  
  1.6       +1 -2      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ssi/SSIFlastmod.java
  
  Index: SSIFlastmod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ssi/SSIFlastmod.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SSIFlastmod.java	23 Apr 2005 10:22:37 -0000	1.5
  +++ SSIFlastmod.java	17 Aug 2005 21:21:37 -0000	1.6
  @@ -33,7 +33,6 @@
               String[] paramNames, String[] paramValues, PrintWriter writer) {
       	long lastModified = 0;
           String configErrMsg = ssiMediator.getConfigErrMsg();
  -        StringBuffer buf = new StringBuffer();
           for (int i = 0; i < paramNames.length; i++) {
               String paramName = paramNames[i];
               String paramValue = paramValues[i];
  
  
  
  1.8       +15 -7     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ssi/SSIServletExternalResolver.java
  
  Index: SSIServletExternalResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ssi/SSIServletExternalResolver.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SSIServletExternalResolver.java	30 Apr 2005 17:20:50 -0000	1.7
  +++ SSIServletExternalResolver.java	17 Aug 2005 21:21:37 -0000	1.8
  @@ -244,7 +244,7 @@
                               uriEncoding =
                                   ((Request)req).getConnector().getURIEncoding();
                               useBodyEncodingForURI = ((Request)req)
  -							        .getConnector().getUseBodyEncodingForURI();
  +                                    .getConnector().getUseBodyEncodingForURI();
                           }
                   
                           // If valid, apply settings from request / connector
  @@ -394,7 +394,7 @@
   
       protected ServletContextAndPath getServletContextAndPathFromVirtualPath(
               String virtualPath) throws IOException {
  -        String path = null;
  +
           if (!virtualPath.startsWith("/") && !virtualPath.startsWith("\\")) {
               return new ServletContextAndPath(context,
                       getAbsolutePath(virtualPath));
  @@ -475,16 +475,24 @@
       public long getFileLastModified(String path, boolean virtual)
               throws IOException {
           long lastModified = 0;
  -        URLConnection urlConnection = getURLConnection(path, virtual);
  -        lastModified = urlConnection.getLastModified();
  +        try {
  +            URLConnection urlConnection = getURLConnection(path, virtual);
  +            lastModified = urlConnection.getLastModified();
  +        } catch (IOException e) {
  +            // Ignore this. It will always fail for non-file based includes
  +        }
           return lastModified;
       }
   
   
       public long getFileSize(String path, boolean virtual) throws IOException {
           long fileSize = -1;
  -        URLConnection urlConnection = getURLConnection(path, virtual);
  -        fileSize = urlConnection.getContentLength();
  +        try {
  +            URLConnection urlConnection = getURLConnection(path, virtual);
  +            fileSize = urlConnection.getContentLength();
  +        } catch (IOException e) {
  +            // Ignore this. It will always fail for non-file based includes
  +        }
           return fileSize;
       }
   
  
  
  

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


Mime
View raw message