tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler JasperMangler.java
Date Mon, 12 Feb 2001 04:07:02 GMT
costin      01/02/11 20:07:01

  Modified:    src/share/org/apache/jasper/compiler JasperMangler.java
  Log:
  Resolved the (common) "//" problem ( URIs with double slashes ).
  ( a more generic fix later, this solves a problem with some existing webapps)
  
  Revision  Changes    Path
  1.3       +9 -1      jakarta-tomcat/src/share/org/apache/jasper/compiler/JasperMangler.java
  
  Index: JasperMangler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JasperMangler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JasperMangler.java	2001/02/06 02:46:25	1.2
  +++ JasperMangler.java	2001/02/12 04:07:00	1.3
  @@ -169,8 +169,16 @@
       private String fixInvalidChars(String className) {
   	// Fix for invalid characters. From CommandLineCompiler
   	StringBuffer modifiedClassName = new StringBuffer();
  +	char c='/';
   	for (int i = 0; i < className.length(); i++) {
  -	    char c=className.charAt(i);
  +	    char prev=c;
  +	    c=className.charAt(i);
  +	    // workaround for common "//" problem. Alternative
  +	    // would be to encode the dot.
  +	    if( prev=='/' && c=='/' ) {
  +		continue;
  +	    }
  +	    
   	    if (Character.isLetterOrDigit(c) == true ||
   		c=='_' ||
   		c=='/' )
  
  
  

Mime
View raw message