RE: Proposed name encoding patch

2001-01-19 Thread Tal Dayan

Yes, this may work. Just remember to encode the escape char '_' as well even
though
it is a valid java id char. Otherwise, the mapping may not be unique.

Tal

 -Original Message-
 From: Steve Downey [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 18, 2001 10:50 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: Proposed name encoding patch


 I was looking at this last night, by coincidence. It seems to me that the
 class
 name is encoding too much information. It's duplicating the
 package as part
 of
 the class name. I suspect it's getting confused between '/', '\',
 File.separatorChar, etc.

 It's also encoding characters that are legal in java class names
 that do not
 happen to be
 Character.isLetterOrDigit(). Should probably be
 Character.isJavaIdentifierStart and
 Character.isJavaIdentifierPart


 -Original Message-
 From: Tal Dayan [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 16, 2001 3:41 AM
 To: [EMAIL PROTECTED]
 Subject: Proposed name encoding patch


 Hello,

 This is my first posting to this list so please bare with me.

 We are having problems with the jsp name mangling (bug 330 at
 http://znutar.cortexity.com/BugRatViewer/ShowReport/330).

 Every '/' or '_' char in the jsp path is converted to 6 chars which easily
 extend the file path beyond Win NT limitation of 256 chars. As a
 result, the
 JSP compilation fails with the following error:

 org.apache.jasper.JasperException: Unable to compile class for JSPerror:
 Can't write:

 D:\tomcat\appserv\work\localhost_8080\system\admin\modes\start\acc
 ount\_0002
 fsystem_0002fadmin_0002fmodes_0002fstart_0002faccount_0002fpage_00
 05fadmin_0
 005fstart_0005faccount_0005fpassword_0002ejsppage_0005fadmin_0005f
 start_0005
 faccount_0005fpassword_jsp_0.class

 A quick look at the code reveals that the mangling is done by the method
 CommandLineCompiler.mangleChar() so we plan to modify the method
 to generate
 a more compact encoding, especially for common chars such as '/', '_', and
 '.'.

 What is the view of the list regarding the proposed modification and how
 should we proceed to maximize the changes that our patch will be
 included in
 the official Tomcat code ?

 Thanks,

 Tal


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 This electronic mail
 transmission
 may contain confidential information and is intended only for the
 person(s)
 named.  Any use, copying or disclosure by any other person is strictly
 prohibited.  If you have received this transmission in error,
 please notify
 the sender via e-mail. 

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




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




RE: Proposed name encoding patch

2001-01-18 Thread Steve Downey

I was looking at this last night, by coincidence. It seems to me that the
class
name is encoding too much information. It's duplicating the package as part
of
the class name. I suspect it's getting confused between '/', '\',
File.separatorChar, etc.

It's also encoding characters that are legal in java class names that do not
happen to be 
Character.isLetterOrDigit(). Should probably be
Character.isJavaIdentifierStart and 
Character.isJavaIdentifierPart


-Original Message-
From: Tal Dayan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 3:41 AM
To: [EMAIL PROTECTED]
Subject: Proposed name encoding patch


Hello,

This is my first posting to this list so please bare with me.

We are having problems with the jsp name mangling (bug 330 at
http://znutar.cortexity.com/BugRatViewer/ShowReport/330).

Every '/' or '_' char in the jsp path is converted to 6 chars which easily
extend the file path beyond Win NT limitation of 256 chars. As a result, the
JSP compilation fails with the following error:

org.apache.jasper.JasperException: Unable to compile class for JSPerror:
Can't write:

D:\tomcat\appserv\work\localhost_8080\system\admin\modes\start\account\_0002
fsystem_0002fadmin_0002fmodes_0002fstart_0002faccount_0002fpage_0005fadmin_0
005fstart_0005faccount_0005fpassword_0002ejsppage_0005fadmin_0005fstart_0005
faccount_0005fpassword_jsp_0.class

A quick look at the code reveals that the mangling is done by the method
CommandLineCompiler.mangleChar() so we plan to modify the method to generate
a more compact encoding, especially for common chars such as '/', '_', and
'.'.

What is the view of the list regarding the proposed modification and how
should we proceed to maximize the changes that our patch will be included in
the official Tomcat code ?

Thanks,

Tal


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
This electronic mail transmission
may contain confidential information and is intended only for the person(s)
named.  Any use, copying or disclosure by any other person is strictly
prohibited.  If you have received this transmission in error, please notify
the sender via e-mail. 

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




RE: Proposed name encoding patch

2001-01-17 Thread Tal Dayan

Hi Costin,

I looked at the code at (one long line)

http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat/src/share/org/apac
he/jasper/compiler/CommandLineCompiler.java?rev=1.6content-type=text/vnd.vi
ewcvs-markup

The mangleChar() method seems to have the old code that encodes as _x
where x
is an hex digit. If I understand the code correctly, this is where we need
to make the patch.

If this is solved somewhere else, please send me pointer so I can give it a
try.

In case we need to write a new encoding method, here are some possible
requirements, I am not sure which of them are relevant and which are not.

1. The encoding of any path should be unique.
2. The file name without the '.class' extension) should be a valid Java
class name.
3. The encoding should be intuitive.
4. The encoding should be compact, at least for common chars.
5. The encoding should support JSP name with Unicode chars.
6. Runtime efficiency. The current encoding for example creates 3 object for
each mangled char.

Any comment from members of the list will be greatly appreciated.

Tal




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 16, 2001 11:40 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Proposed name encoding patch


 It's worth to mention that both JSP encoding and work dir encoding are
 resolved/improved in 3.3 - and the code can be easily ported back /
 reused.

 I'll take a look at both patches and try to integrate them into 3.3 also (
 what is not covered already )

 --
 Costin


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




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




RE: Proposed name encoding patch

2001-01-17 Thread Tal Dayan

Hi Kim,

That's great. I have few questions:

1. Have you submitted the patch to the Tomcat repository ? If so,
do you know in what version it will be released ?

2. Also, the encoding that you use is of the form %hh where 'hh' is an hex
value. I had the implression that for public classes, the .class file name
should match the file name. Don't you have a problem with that (since a
class name cannot contain '%') ?

3. In what part of the code did you made the change, was it in mangleChar()
method ?

Thanks

Tal

 -Original Message-
 From: Pilho Kim [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 16, 2001 11:06 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Proposed name encoding patch


 Hi, Tal

 I have ever solved the problem already.
 Try to check
 http://w4.metronet.com/~wjm/tomcat/2000/Aug/msg00595.html

 Thanks,
 Kim


 On Tue, 16 Jan 2001, Tal Dayan wrote:

  Hello,
 
  This is my first posting to this list so please bare with me.
 
  We are having problems with the jsp name mangling (bug 330 at
  http://znutar.cortexity.com/BugRatViewer/ShowReport/330).
 
  Every '/' or '_' char in the jsp path is converted to 6 chars
 which easily
  extend the file path beyond Win NT limitation of 256 chars. As
 a result, the
  JSP compilation fails with the following error:
 
  org.apache.jasper.JasperException: Unable to compile class for JSPerror:
  Can't write:
 
 
 D:\tomcat\appserv\work\localhost_8080\system\admin\modes\start\acc
 ount\_0002
 
 fsystem_0002fadmin_0002fmodes_0002fstart_0002faccount_0002fpage_00
 05fadmin_0
 
 005fstart_0005faccount_0005fpassword_0002ejsppage_0005fadmin_0005f
 start_0005
  faccount_0005fpassword_jsp_0.class
 
  A quick look at the code reveals that the mangling is done by the method
  CommandLineCompiler.mangleChar() so we plan to modify the
 method to generate
  a more compact encoding, especially for common chars such as
 '/', '_', and
  '.'.
 
  What is the view of the list regarding the proposed modification and how
  should we proceed to maximize the changes that our patch will
 be included in
  the official Tomcat code ?
 
  Thanks,
 
  Tal
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, email: [EMAIL PROTECTED]
 
 


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




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




Re: Proposed name encoding patch

2001-01-16 Thread cmanolache

It's worth to mention that both JSP encoding and work dir encoding are
resolved/improved in 3.3 - and the code can be easily ported back /
reused. 

I'll take a look at both patches and try to integrate them into 3.3 also (
what is not covered already ) 

-- 
Costin


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