Good day

2005-07-07 Thread arieh . markel
The message cannot be represented in 7-bit ASCII encoding and has been sent as 
a binary attachment.



Norton AntiVirus Deleted1.txt
Description: plain/text
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Good day

2005-07-07 Thread arieh . markel
The message cannot be represented in 7-bit ASCII encoding and has been sent as 
a binary attachment.



Norton AntiVirus Deleted1.txt
Description: plain/text
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Tomcat Admin Web Interface

2001-06-14 Thread Arieh Markel

And following on this topic.

Following brief conversations during JavaOne with Craig, Costin, Remy,
I began thinking of developing some code (base in my past experience in
embedding Tomcat and subsequently 'advertising' my container through Jini)
that would allow to 'publish' the existence of Tomcat instances in
distributed environments.

The list of APIs that this could apply to includes but is not limited
to:
Jini - would allow to have an RMI-based administrative interface
SLP - to expose a service interface through the Service Locator
Protocol
JXTA - similar to the above, using the JXTA infrastructure and APIs

From the perspective of my own experience, I have an initial implementation
of the first one (the one for the StorEdge embedding of Tomcat), while the
two others would force to develop a lot more code, since the support
infrastructure is not there yet (for JXTA at least, to my understanding).

--

In any case, if such contributions are deemed useful, there would be
a need to define the administrative service interface that Tomcat
requires, to be implemented by the Jini/JXTA/SLP service(s).

--

What do you think ?

Arieh

PS - I forgot to mention a J2EE interface to manage Tomcat, which
 probably fits the view of those in the J2EE world.

 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: Craig R. McClanahan [EMAIL PROTECTED]
 X-Sender: craigmcc@localhost
 To: [EMAIL PROTECTED]
 Subject: Re: Tomcat Admin Web Interface
 
 
 
 On Thu, 14 Jun 2001, M B wrote:
 
  Hello All,
  
  In response to the recent postings regarding Tomcat
  documentation and administration (Re: ~rant~ Docs,
  user list, etc.), I am willing to contribute much
  effort in this area.  In addition to documentation, I
  am particularly interested in helping to build an
  administrative web interface for Tomcat 4.0, something
  similar to JRun Management Console, for example.
  
 
 That would be awesome!
 
  Naturally, I want to coordinate my efforts with the
  Tomcat community.  Can anyone please point out where I
  should begin, or who I should contact?  Is there a
  project for this?  The Catalina TODO identifies John
  Shin as volunteer for producing an admin interface,
  but I thought I should email this list before
  contacting him directly.  
  
 
 He volunteered long, long, ago but I haven't heard anything from him
 lately.
 
 As it happens, I've been accumulating a list of functional requirements
 for admin capabilities that I'd like to post for discussion.  I'll be
 finished with what I'm thinking in the next couple of days.
 
 What I'd like to see us do on issues like this is to discuss and agree on
 a functional specs document that is checked in to the CVS repository, and
 then start working together on the pieces.  It's a little more formal than
 the usual :-) open source approach, but I think it will help in the long
 run.  Does that sound like a useful plan?
 
  Thanks,
  Matt
  
 
 Craig

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




RE: [VOTE] Final release of Tomcat 3.2.2

2001-05-18 Thread Arieh Markel


Great job.

See you at JavaOne.


-
 
 Vote to release the tomcat_32 branch as Tomcat 3.2.2.
 
 [X] +1.  I agree with the proposal and I will help support
  the release.
 [ ] +0.  I agree with the proposal but I will not be able
  to help support the release.
 [ ] -0.  I don't agree with the proposal but I won't stop
  the release.
 [ ] -1.  I disagree with the proposal and will explain my
  reasons.

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: FW: Java World Editors' Choice Awards

2001-05-14 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Delivered-To: mailing list [EMAIL PROTECTED]
 User-Agent: Microsoft-Entourage/9.0.1.3108
 Subject: FW: Java World Editors' Choice Awards
 From: Jon Stevens [EMAIL PROTECTED]
 To: tomcat-dev [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 
 I'm totally amazed no one from here has responded to Scott yet (especially
 you Sun people).
 
 Come on people, please get in touch with him.

For what is worth, (having contributed some code to TC 3.2)
I will be at JavaOne during that week.

Is anybody else going to be present there ?

Arieh

 
 -jon
 
 -- Forwarded Message
 From: [EMAIL PROTECTED]
 Date: Mon, 14 May 2001 11:13:13 -0700
 To: [EMAIL PROTECTED]
 Subject: Java World Editors' Choice Awards
 
 Jon,
 
 I haven't heard from anyone yet. Can you represent Tomcat at the ceremony?
 It'll be on Tuesday evening , June 5, here in San Francisco. Up to four
 people can attend. If yes, would you send me your contact information, as
 outlined in the email below?
 
 Regards,
 Scott
 
 - Forwarded by Scott Plamondon/ITWORLD on 05/14/2001 11:13 AM -

 Dear Jakarta Project,
 
 Congratulations! JavaWorld has selected Jakarta Project's Tomcat 3.2 as a
 finalist in the Most Innovative Java Product category of our Editors'
 Choice Awards.
 
 Established in 1997, the awards recognize those innovative companies,
 organizations, and individuals committed to developing new Java tools and
 technologies that drive the platform forward. More than 100 products and
 technologies were nominated by vendors, readers, as well as JavaWorld
 editors and writers. We'll publish the complete list of finalists in each
 category by 5 p.m. PDT on Friday, May 4 (go to:
 http://www.javaworld.com/jw-05-2001/jw-0504-finalists.html).
 
 As a finalist, members of your product team will be invited to attend
 JavaWorld's Editors' Choice Awards ceremony at the JavaOne Conference and
 Expo from June 4-8 in San Francisco, where a winner in each category will
 be announced. Invitations to the ceremony, with the date and location, will
 be mailed in mid-May.
 
 With that in mind, I need to confirm your organization's contact
 information. Please let me know to whom we should send the invitation at
 your earliest convenience:
 
 Contact Name:
 Title:
 Product Name:
 Address:
 City, State, Zip:
 Phone:
 Email:
 
 If you have any questions, please don't hesitate to email me at this
 address or call 415-975-2651.
 
 Regards,
 
 Scott Plamondon
 Senior Editor
 JavaWorld
 [EMAIL PROTECTED]
 415-975-2651
 
 
 
 
 -- End of Forwarded Message

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Solaris Sparc Performance Problem

2001-04-24 Thread Arieh Markel

Here is what I would do to see the differences:

. on Solaris, run the application through truss

. on Linux, run the application through strace

This should yield information about where the time is being spent.

I am also wondering whether the Solaris machine is properly configured
with regards to things like nameserver lookups, proxy setups, etc.

Arieh

 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: [EMAIL PROTECTED] (Douglas E. Hornig)
 Subject: Solaris Sparc Performance Problem
 To: [EMAIL PROTECTED]
 Content-Disposition: inline
 X-MIME-Autoconverted: from quoted-printable to 8bit by amon.Central.Sun.COM id 
LAA19808
 
 I posed this problem to the good folks on the users list.  While they are a 
great bunch, and several offered some suggestions, I was unable to get any help 
from them so I'm trying the dev list now.
 
 The problem in a nutshell is that requests I make to tomcat running on a 
Solaris Sparc from a Windows client take at least 0.15 to 0.20 seconds.  If I 
run tomcat on a Linux PC, or use a Linux PC as a client instead of Windows, the 
turnaround time is more like 0.01 seconds.
 
 Here are the particulars:
 
 * All machines are on the same 100Mbit ethernet.
 * Tomcat is running standalone.
 * I tried a couple of different Sparcs, a 420R and an Ultra 5, neither with 
any load.  No difference.
 * I wrote a simple Java program to use as the test client so there are no 
browsers involved.
 * I tried various different Java VM releases on the Sparcs, 1.2.1 and 1.3.0 
with no difference seen.
 * I tried a couple different PCs (NT4 and Win2000) and found the same results.
 * Other programmers here reported slowness using VisualBasic as the client 
instead of Java (that's how I got started investigating this).  Java Web Server 
2.0 also appeared to have the same problem as tomcat.  I have not personally 
been able to verify these assertions.
 * The results seem very repeatable.
 * I used a generic tomcat 3.2.1 for the server and hit the 
examples/servlet/HelloWorldExample URL for these tests.
 
 This is a very serious problem for us.  The above mentioned VB client that 
we're developing can make dozens of calls to the server per screen, so those 0.2 
second delays add up.  I like Linux a lot myself but the bosses here feel more 
comfortable with more traditional business models, and besides shouldn't Java 
run best on a Sparc with Solaris?  I am perplexed as to what the problem is and 
would greatly appreciate any help or ideas I can get.
 
 Thanks in advance,
 
 Douglas Hornig
 Dartmouth-Hitchcock Medical Center
 Lebanon, NH

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: TC3.3 - building javadoc

2001-03-26 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: Mel Martinez [EMAIL PROTECTED]
 Subject: TC3.3 - building javadoc
 To: [EMAIL PROTECTED]
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 Currently, when you run the build script (for TC 3.3),
 build.xml has 'dist' dependent on the 'javadoc'
 target.  The 'javadoc' target compiles javadoc pages
 for org.apache.tomcat.core and
 org.apache.tomcat.modules.*.
 
 I dunno about you, but this seems insufficient for
 'dist'.  Shouldn't the javadoc set for distribution
 include all or most of the packages?  
 
 Also, it would probably be useful for dev
 documentation purposes to have some secondary javadoc
 targets like javadoc.tomcat.core',
 'javadoc.tomcat.util', 'javadoc.tomcat.modules',
 'javadoc.jasper', etc.  That way when you work on the
 javadocs for a package you can rapidly compile just
 that section.  This MIGHT encourage better documenting
 of code than is currently happening... :-)
 
 Anybody else think this is a good (or bad) idea?

I think this is a good idea.

Here is a snipped of a modified generatedocs.sh script that I built to
create the javadocs (it is not updated but a snapshot of 3.3 at the time):

javadoc -verbose -sourcepath src/share -d 
/ws/sx1.0-tools/jakarta/v3.2-4/dist/jakarta-tomcat/doc/api -use -version -author 
-windowtitle "Jakarta/Java Servlet API Reference, v2.2" -doctitle "Jakarta/Java 
Servlet API Reference, v2.2" \
javax.servlet \
javax.servlet.http \
javax.servlet.jsp \
javax.servlet.jsp.tagext \
org.apache.jasper \
org.apache.jasper.compiler \
org.apache.jasper.runtime \
org.apache.jasper.servlet \
org.apache.tomcat.context \
org.apache.tomcat.core \
org.apache.tomcat.helper \
org.apache.tomcat.logging \
org.apache.tomcat.modules.server \
org.apache.tomcat.request \
org.apache.tomcat.service \
org.apache.tomcat.service.connector \
org.apache.tomcat.service.http \
org.apache.tomcat.session \
org.apache.tomcat.startup \
org.apache.tomcat.task \
org.apache.tomcat.util \
org.apache.tomcat.util.depend \
org.apache.tomcat.util.net \
org.apache.tomcat.util.pattern \
org.apache.tomcat.util.threads \
org.apache.tomcat.util.xml 

(the package list need to be updated).

Arieh
 
 Mel
 
 
 __
 Do You Yahoo!?
 Get email at your own domain with Yahoo! Mail. 
 http://personal.mail.yahoo.com/

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




to trim or not to trim (was Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util FileUtil.java)

2001-03-21 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: Yoshiyuki Karezaki [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util 
FileUtil.java
 User-Agent: Wanderlust/2.4.1 (Stand By Me) Emacs/20.4 Mule/4.1 (AOI)
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 Hi arieh,
 
 In article cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util 
FileUtil.java,
   [EMAIL PROTECTED] wrote:
 |public static String patch(String path) {
 |   - String patchPath = path;
 |   + String patchPath = path.trim();
 
 The fix of 1.9.2.6 becomes ineffective.
 trim() should be removed ?

Yoshiyuki,

Thanks for your comments.

Before I go ahead with reverting the code to what it was before.

Can you explain why the addition of trim makes the fix ineffective ?

The trim() protects from generating invalid paths that may result
from appended spaces.

Are you suggesting that we don't try to fix the possible existence of
appended spaces (or CR LF) ?

Have you seen any problem with the current version ?

Other opinions ?

Thanks,

Arieh

 
 Yoshiyuki Karezaki   [EMAIL PROTECTED]

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




RE: to trim or not to trim (was Re: cvs commit: jakarta-tomcat/sr c/share/org/apache/tomcat/util FileUtil.java)

2001-03-21 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: Larry Isaacs [EMAIL PROTECTED]
 To: "'[EMAIL PROTECTED]'" [EMAIL PROTECTED]
 Subject: RE: to trim or not to trim (was Re: cvs commit: jakarta-tomcat/sr 
c/share/org/apache/tomcat/util FileUtil.java)
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 

 
 The trim() was removed to fix a security vulnerability that can
 occur if the URL ends with ".jsp%20".  This results in the JSP
 being served statically.  See Bugzilla Bug #748.
 
 Where would valid spaces or CRLF come from?  Perhaps we can look
 for a better place to trim them.  Doing this in patch() means
 that some portions of Tomcat will see a request that is
 technically different from what other portions see.

I will remove the 'trim()' call.

Arieh

 
 Cheers,
 Larry
 
  
  Have you seen any problem with the current version ?
  
  Other opinions ?
  
  Thanks,
  
  Arieh
  
   
   Yoshiyuki Karezaki   [EMAIL PROTECTED]
  
  --
   Arieh Markel   Sun Microsystems Inc.
   Network Storage500 Eldorado Blvd. MS 
  UBRM11-194
   e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
   Pray for snow  Phone: (303) 272-8547 x78547
   (e-mail me with subject SEND PUBLIC KEY to get public key)
  

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util FileUtil.java

2001-03-21 Thread arieh

arieh   01/03/21 14:23:08

  Modified:src/share/org/apache/tomcat/util Tag: tomcat_32
FileUtil.java
  Log:
  Remove the trim() call.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.9.2.8   +4 -4  
jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java
  
  Index: FileUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java,v
  retrieving revision 1.9.2.7
  retrieving revision 1.9.2.8
  diff -u -r1.9.2.7 -r1.9.2.8
  --- FileUtil.java 2001/03/16 23:39:50 1.9.2.7
  +++ FileUtil.java 2001/03/21 22:23:06 1.9.2.8
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java,v 
1.9.2.7 2001/03/16 23:39:50 arieh Exp $
  - * $Revision: 1.9.2.7 $
  - * $Date: 2001/03/16 23:39:50 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java,v 
1.9.2.8 2001/03/21 22:23:06 arieh Exp $
  + * $Revision: 1.9.2.8 $
  + * $Date: 2001/03/21 22:23:06 $
*
* 
*
  @@ -228,7 +228,7 @@
   }
   
   public static String patch(String path) {
  - String patchPath = path.trim();
  + String patchPath = path;
   
// Move drive spec to the front of the path
if (patchPath.length() = 3 
  
  
  



cvs commit: jakarta-tomcat/src/doc tomcat-localization-howto.html

2001-03-20 Thread arieh

arieh   01/03/20 08:31:10

  Added:   src/doc  Tag: tomcat_32 tomcat-localization-howto.html
  Log:
  First revision of the localization HOWTO.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.1.2.1   +198 -0jakarta-tomcat/src/doc/Attic/tomcat-localization-howto.html
  
  
  
  



Re: [TC3.2.2] Codebase frozen (was RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request StaticInterceptor.java)

2001-03-19 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: "Marc Saegesser" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [TC3.2.2] Codebase frozen (was RE: cvs commit: 
jakarta-tomcat/src/share/org/apache/tomcat/request StaticInterceptor.java)
 Importance: Normal
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 You are correct, this should not have gone into the tomcat_32 branch.  The
 only things that should be commited to tomcat_32 are bug fixes for existing
 functionality.  Anything else should only be committed with the approval of
 the Release Manager (i.e. Me).  I'm going to review these changes to see if
 they will remain in the 3.2 code base or not.  Arieh, could you please
 supply some test cases and updated documentation?

I will do that shortly.

It is not clear to me how to automate the testing. The way I have been
testing is to use my browser, alternate to set different language
preferences and test that I am getting the right page according to
the language selected.

In any case, I will document how to test.

I will proceed with supplying the documentation.

Arieh

 
 I had hoped to have released 3.2.2b2 by now, but I've been very busy with my
 day job and so have not had much time to devote to the release.  Things
 should be winding down now so I hope to be wrapping up the beta release
 shortly.  We're down to about 75 open bugs against Tomcat-3.  I'm still
 working through all of these to evaluate if they are real problems or user
 errors.  If they are real problems I'm making a determination of whether
 they should be fixed in 3.2.2 or differed.  The major decision criteria is
 specification compliance, but simple fixes to existing functionality are
 being made, too.
 
 On a related topic.  Lots of the remaining Bugzilla issues have assigned
 owners.  The 3.2.2 release plan calls for all open issues to have a
 resolution other than NEW (e.g. FIXED, LATER, INVALID, ...).  If developers
 have time to update their assigned issues I would appreciate it.  If I make
 a change to one of your assigned items that you disagree with, please don't
 hesitate to contact me so we can work it out.
 
  -Original Message-
  From: David Rees [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, March 17, 2001 12:16 PM
  To: [EMAIL PROTECTED]
  Subject: Re: cvs commit:
  jakarta-tomcat/src/share/org/apache/tomcat/request
  StaticInterceptor.java
 
 
  On Fri, Mar 16, 2001 at 11:42:00PM -, [EMAIL PROTECTED] wrote:
   arieh   01/03/16 15:42:00
  
 Modified:src/share/org/apache/tomcat/request Tag: tomcat_32
   StaticInterceptor.java
 Log:
 Add support for docbase localization lookup.
 
  Maybe I'm missing something here, but should this have been committed
  to the tomcat_32 branch when the code is frozen for 3.2.2?
 
  -Dave

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util FileUtil.java

2001-03-17 Thread arieh

arieh   01/03/16 15:39:52

  Modified:src/share/org/apache/tomcat/util Tag: tomcat_32
FileUtil.java
  Log:
  Add support for docbase localized lookups.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.9.2.7   +216 -5
jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java
  
  Index: FileUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java,v
  retrieving revision 1.9.2.6
  retrieving revision 1.9.2.7
  diff -u -r1.9.2.6 -r1.9.2.7
  --- FileUtil.java 2001/03/05 04:02:49 1.9.2.6
  +++ FileUtil.java 2001/03/16 23:39:50 1.9.2.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java,v 
1.9.2.6 2001/03/05 04:02:49 marcsaeg Exp $
  - * $Revision: 1.9.2.6 $
  - * $Date: 2001/03/05 04:02:49 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/Attic/FileUtil.java,v 
1.9.2.7 2001/03/16 23:39:50 arieh Exp $
  + * $Revision: 1.9.2.7 $
  + * $Date: 2001/03/16 23:39:50 $
*
* 
*
  @@ -228,7 +228,7 @@
   }
   
   public static String patch(String path) {
  - String patchPath = path;
  + String patchPath = path.trim();
   
// Move drive spec to the front of the path
if (patchPath.length() = 3 
  @@ -421,7 +421,8 @@
   }
   
   /**  utility method to return the name of the localized file whose
  - *   name best-matches the Locale passed as an argument
  + *   name best-matches the Locale passed as an argument using the
  + *   'file-based' lookup mechanism.
*
*  @param base the directory that is the Document Base for the context
*   in which the 'path' passed is expected to be located
  @@ -441,6 +442,7 @@
   /**  utility method to get the best-match for getting the Localized
*   version of the file whose 'path' is passed as an argument, using
*   the 'loc' Locale, and performing 'safePath'checks
  + *   The algorithm used matches 'file-based' lookup mechanism.
*
*  The method performs a resource lookup in a manner similar to the
*  one specified by java.util.ResourceBundle.
  @@ -592,4 +594,213 @@
return null;
   }
   
  +/**  utility method to return the name of the localized file whose
  + *   name best-matches the Locale passed as an argument using the
  + *   'docbase-based' lookup mechanism.
  + *
  + *  @param base the directory that is the Document Base for the context
  + *   in which the 'path' passed is expected to be located
  + *  @param path the pathname for the file that is being searched for its
  + *   best-matched Localized version
  + *  @param loc the requested Locale to match
  + *  @param fbloc the requested fall-back Locale to match
  + *
  + *  @return the name of the file that best-matched the Locale requested
  + */
  +public static String getDocBaseLocalizedFile (String base,
  +String path,
  +Locale loc,
  +Locale fbloc) {
  + return getDocBaseLocalizedResource (base, path, loc, fbloc);
  +}
  +
  +/**  utility method to get the best-match for getting the Localized
  + *   version of the file whose 'path' is passed as an argument, using
  + *   the 'loc' Locale, and performing 'safePath'checks
  + *   The algorithm used matches 'docBase-based' lookup mechanism.
  + *
  + *  In the case of 'typed' files (files whose name is [file].[ftype])
  + *  search for localized versions of the file are looked for:
  + *
  + *   docbase + "/" + language1 + "_" + country1 + "_" + variant1 + filepath 
  + *   docbase + "/" + language1 + "_" + country1 + filepath 
  + *   docbase + "/" + language1 + filepath 
  + *
  + *  Where language1, country1, variant1 are associated with the Locale
  + *  passed as an argument. 
  + *
  + *  For example, if the preferred Locale is CODEes_AR_POSIX/CODE
  + *  the docBase is '/' and  pathname is CODE/foo/bar/index.html/CODE,
  + *  then a search for the following localized versions of that file will
  + *  be done, in order:
  + *UL
  + *LI/es_AR_POSIX/foo/bar/index.html/LI
  + *LI/es_AR/foo/bar/index.html/LI
  + *LI/es/foo/bar/index.html/LI
  + *LI/foo/bar/index_es.html/LI
  + */UL
  + *
  + *  @param base the directory that is the Document Base for the context
  + *   in which the 'path' passed i

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request StaticInterceptor.java

2001-03-17 Thread arieh

arieh   01/03/16 15:42:00

  Modified:src/share/org/apache/tomcat/request Tag: tomcat_32
StaticInterceptor.java
  Log:
  Add support for docbase localization lookup.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.7.2.9   +65 -23
jakarta-tomcat/src/share/org/apache/tomcat/request/Attic/StaticInterceptor.java
  
  Index: StaticInterceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/Attic/StaticInterceptor.java,v
  retrieving revision 1.7.2.8
  retrieving revision 1.7.2.9
  diff -u -r1.7.2.8 -r1.7.2.9
  --- StaticInterceptor.java2001/03/13 22:03:19 1.7.2.8
  +++ StaticInterceptor.java2001/03/16 23:41:57 1.7.2.9
  @@ -186,7 +186,12 @@
if (localization == FILE_LOC)
absPath = ctx.getRealPath (pathInfo,
   RequestUtil.getLocale(req),
  -Locale.getDefault());
  +Locale.getDefault(), "file");
  + else if (localization == DOCB_LOC)
  + absPath = ctx.getRealPath (pathInfo,
  +RequestUtil.getLocale(req),
  +Locale.getDefault(), "docbase");
  +
else
absPath = ctx.getRealPath( pathInfo );
   
  @@ -213,8 +218,10 @@
   
// Directory, check if we have a welcome file
String welcomeFile = null;
  - if (localization == FILE_LOC)
  - welcomeFile = getWelcomeFile(ctx, file,
  +
  + //
  + if (localization == FILE_LOC || localization == DOCB_LOC)
  + welcomeFile = getWelcomeFile(ctx, pathInfo,
 RequestUtil.getLocale(req),
 Locale.getDefault());
else
  @@ -275,31 +282,69 @@
return null;
   }
   
  -private String getWelcomeFile(Context context, File dir,
  +private String getWelcomeFile(Context context, String path,
  Locale loc, Locale fbloc) {
Enumeration enum = context.getWelcomeFiles();
   
  + String docBase = context.getAbsolutePath();
  + StringBuffer sb = new StringBuffer(docBase);
  +
while (enum.hasMoreElements()) {
String fileName = (String)enum.nextElement();
   
  - int  ftype = fileName.lastIndexOf ('.');
  - String fbasen = (ftype != -1)
  - ? fileName.substring (0, ftype)
  - : fileName;
  -
  - String fPath = dir.getAbsolutePath()
  -  + File.separatorChar
  -  + fileName;
  -
  - String retPath = FileUtil.getLocalizedResource (fPath,
  - loc,
  - fbloc);
  - if ((new File(retPath)).exists())
  + String retPath = null;
  + 
  + if (localization == FILE_LOC)
{
  - int pathPos = retPath.lastIndexOf (fbasen);
  - return retPath.substring (pathPos);
  + //  preserve the basename of the path, so that the
  + //  localized version can be identified following
  + //  the lookup
  + //
  + int  ftype = fileName.lastIndexOf ('.');
  + String fbasen = (ftype != -1) 
  + ? fileName.substring (0, ftype)
  + : fileName;
  +
  + String fp = concatPath(docBase, fileName);
  +
  + retPath = FileUtil.getLocalizedResource (
  +  fp,
  +  loc,
  +  fbloc);
  + if (new File(retPath).exists())
  + {
  + int pathPos = retPath.lastIndexOf (fbasen);
  + return retPath.substring (pathPos);
  + }
}
  + else// localize according to DOCBASE
  + {
  + //  make sure there is a File.separator between the
  + //  passed path and the welcome file
  + //
  + if (null != path)
  + {
  + sb = new StringBuffer(path);
  + if (! path.endsWith(File.separator))
  + sb.append(File.separatorChar);
  + }
  + else
  + sb = new StringBuffer();
  +
  + sb.append (fileName);
  +
  + retPath = FileUtil.getDocBaseLocalizedResource (
  + docBase,
  +

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core Context.java

2001-03-17 Thread arieh

arieh   01/03/16 15:43:56

  Modified:src/share/org/apache/tomcat/core Tag: tomcat_32 Context.java
  Log:
  Add support for 'docbase' localization lookup to the getRealPath() method.
  Preserve backwards compatibility on the getRealPath(path, loc, loc) call.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.100.2.5 +48 -3 jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java
  
  Index: Context.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java,v
  retrieving revision 1.100.2.4
  retrieving revision 1.100.2.5
  diff -u -r1.100.2.4 -r1.100.2.5
  --- Context.java  2000/11/18 00:09:42 1.100.2.4
  +++ Context.java  2001/03/16 23:43:53 1.100.2.5
  @@ -807,7 +807,8 @@
   }
   
   /**  method to return the Localized version of the file whose
  - *   name is passed as an argument.
  + *   name is passed as an argument. This corresponds to "file" type
  + *   localization resource lookup mechanism.
*
*  The method performs a resource lookup in a manner similar to the
*  one specified by java.util.ResourceBundle.
  @@ -854,11 +855,55 @@
*/
   public String getRealPath (String path, Locale reqLocale, Locale fbLocale)
   {
  + return getRealPath (path, reqLocale, fbLocale, "file");
  +}
  +
  +/**  method to return the Localized version of the file whose
  + *   name is passed as an argument. The localization is done based
  + *   on localization subdirectories under the docBase.
  + *
  + *  The method performs a resource lookup in a manner similar to the
  + *  one used for JavaHelp resources.
  + *
  + *  Search for localized versions of the file are looked for:
  + *
  + *   docBase + "/" + language1 + "_" + country1 + "_" + variant1 + file
  + *   docBase + "/" + language1 + "_" + country1 + file
  + *   docBase + "/" + language1 + file
  + *   docBase + "/" + language2 + "_" + country2 + "_" + variant1 + file
  + *   docBase + "/" + language2 + "_" + country2 + file
  + *   docBase + "/" + language2 + file
  + *   docBase + file
  + *
  + *  Where language1, country1, variant1 are associated with the Locale
  + *  passed as an argument and language2, country2, variant are associated
  + *  with the fallback Locale passed as argument.
  + *
  + *
  + *  @param path the pathname for the resource whose localized version
  + *  we are seeking
  + *  @param loc the Locale we are interested in.
  + *  @param fbLoc the fallback Locale to use if unsuccessful
  + *  @param locType the type of localization required "file", "docbase"
  + *
  + *  @return a String with the path of the "best localized match" for
  + *  the file whose path has been passed as argument.
  + */
  +public String getRealPath (String path, Locale reqLocale, Locale fbLocale,
  +String locType)
  +{
   String base = getAbsolutePath();
   if (path == null) path = "";
  +
  +String realPath = null;
  +
  + if ("file".equals (locType))
  + realPath = FileUtil.getLocalizedFile (base, path,
  +   reqLocale, fbLocale);
  + else if ("docbase".equals (locType))
  + realPath = FileUtil.getDocBaseLocalizedFile (base, path,
  +   reqLocale, fbLocale);
   
  -String realPath = FileUtil.getLocalizedFile (base, path,
  -  reqLocale, fbLocale);
if( debug5) {
log("Get real path " + path + " " + realPath + " " + base
 + reqLocale.toString() + " " + fbLocale.toString() );
  
  
  



Re: [VOTE] New commiter - Casey Lucas

2001-03-16 Thread Arieh Markel

+1

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Proposal for implementation of lookup of localized web-resources

2001-03-16 Thread Arieh Markel


 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: Re: Proposal for implementation of lookup of localized 
web-resources
 From: [EMAIL PROTECTED] (Kazuhiro Kazama)
 X-Dispatcher: imput version 2228(IM140)
 
 Arieh,
 
 Basically lookup of localized resources is welcomed. As I have
 evaluated your localization codes to 3.2, I write comments:
 
 1, Your file-based naming scheme isn't compatible with apache
 MultiView function that David Rees and Takashi Okamoto says.
 
 Now apache naming scheme becomes popular in Japan. But almost nobody
 uses your naming scheme. It is unhappy that we must change all
 filename that is written by apache naming scheme.
 
 At the least, compatible option is needed.

I don't think that my intent was to be compatible with Apache.

My first goal was to be compatible with Java localization.

The context in which I am using Jakarta is as an 'embedded' servlet
container inside of a Java application.

 
 2, In your file-based approach  docbase-approach, we can't specify
 charset of HTML files. It is desiable that charset will be supported
 in consideration of Content-Type header.

That is certainly an improvement that can be done.

 
 3, I think your file-based lookup don't work for JSP files by my
 experience (true?). But I hope you will support same localization for
 JSP files.

I believe it does.


Since you appear to be very experienced in areas of localization, it
would be very welcome if you proceeded to enhance the work that I
started.

Thanks for your comments.

Arieh

 
 Kazuhiro Kazama ([EMAIL PROTECTED])   NTT Network Innovation Laboratories

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Proposal for implementation of lookup of localized web-resources

2001-03-16 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: "Takashi Okamoto" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: Proposal for implementation of lookup of localized 
web-resources
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 Hi!!
 
 From: "Arieh Markel" [EMAIL PROTECTED]
  Assume locale in request is: fr_CA
  Assume locale of where tomcat is set: en_US
 
 
 requested path
 
docbase/dir/.../index.html
 
 file-based: (path/filebasename[locale].filetype)
 
  1. docbase/dir/.../index_fr_CA.html
  2. docbase/dir/.../index_fr.html
  3. docbase/dir/.../index_en_US.html
  4. docbase/dir/.../index_en.html
  5. docbase/dir/.../index.html
 
 
 docbase-based: ([locale]/path/filename)
 
  1. docbase/fr_CA/dir/.../index.html
  2. docbase/fr/.../index.html
  3. docbase/en_US/.../index.html
  4. docbase/en/.../index.html
  5. docbase/dir/.../index.html
 
 Did you read following apache URL?
 http://httpd.apache.org/docs-2.0/content-negotiation.html
 
 I think your proopsal is good. But unfortunately, your proposal will lose
 compatibility with Apache.

I am not aware that we have compatibility with Apache now.

From my own perspective implementing exclusively apache localization
compatibility is actually 'bad'. Our deliverables are usually not apache
dependent/nor based. Out localization experts seek compatibility
with Java localization.


 Please rewrite your proposal.

No, I am not going to rewrite my proposal. I explain below how developers
interested on the apache scheme can implement it.

I 'scratched my own itch' with the proposal that I brought up. My own
itch does not include compatibility with Apache, it includes
compatibility with localization schemes in the Java world (the ones
I looked up are ResourceBundle and JavaHelp).

Given that the alternative is to choose from the below:

. use the current proposal as the basis, and extend to support
  all kinds of localization
. not have localization at all until someone implements exclusive
  apache localization

tell me which one you prefer.

---

As an aside, here is how apache compatibility can be achieved (I will
leave the implementation of apache-compatible localization as an exercise
to those who have that itch to scratch).

. the StaticInterceptor has the 'localization' attribute available.

  currently, 'file', 'docbase' are the options.
  
  Add a 'apache' option to the permissible values.
  
  On FileUtil, implement a:
  
getApacheLocalizedResource ()

  method
  
  On Context, add to the logic of 'getRealFile()' to handle 'apache'
  type localization, invoking the method in FileUtil.
  

Such a scheme will allow to add more different localization mechanisms
in the future.

---

So, what I proposed is the mechanism for introduction for various
localization lookup schemes, and to start from the set that I proposed.


Thanks for your comments.

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Proposal for implementation of lookup of localized web-resources

2001-03-16 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: "Arshad Mahmood" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: Proposal for implementation of lookup of localized 
web-resources
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 
 - Original Message -
 From: "Arieh Markel" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Friday, March 16, 2001 3:00 PM
 Subject: Re: Proposal for implementation of lookup of localized
 web-resources
 
 
 
   To: [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
   Subject: Re: Proposal for implementation of lookup of localized
  web-resources
   From: [EMAIL PROTECTED] (Kazuhiro Kazama)
   X-Dispatcher: imput version 20000228(IM140)
  
   Arieh,
  
   Basically lookup of localized resources is welcomed. As I have
   evaluated your localization codes to 3.2, I write comments:
  
   1, Your file-based naming scheme isn't compatible with apache
   MultiView function that David Rees and Takashi Okamoto says.
  
   Now apache naming scheme becomes popular in Japan. But almost nobody
   uses your naming scheme. It is unhappy that we must change all
   filename that is written by apache naming scheme.
  
   At the least, compatible option is needed.
 
  I don't think that my intent was to be compatible with Apache.
 
  My first goal was to be compatible with Java localization.
 
  The context in which I am using Jakarta is as an 'embedded' servlet
  container inside of a Java application.
 
 This is something which I am currently in need of for a project. The only
 reason I can see support for the Apache model is that the new mod_webapp
 connector I believe is structured so that static html is served by Apache
 and the dynamic side by tomcat, under these circumstances it would be better
 if they were both the same.
 
 Having said that, my own preference for my current project is for a DocBase
 approach.

Arshad,

thanks for your comments.

The implementation does not enforce any default.

Initially, there are three optional lookup schemes:

a. no localization (do not set the localization attribute on
StaticInterceptor) - this is the default
b. docbase localization (set to "docbase")
c. file localization (set to "file")

As mentioned in a previous post, the mechanisms are in place to add
other localization schemes.

Arieh

PS: as an aside, I believe Apache would benefit with a docbase-like
localization scheme. The advantage is to preserve separation of
localized content (which makes it easier to manage, especially
    when developing the content).
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




RE: [VOTE] New Committer: Amy Roh

2001-03-16 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: GOMEZ Henri [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: RE: [VOTE] New Committer:  Amy Roh
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 That's what I've been telling Gomez in a private thread, we're 
 going to meet later in April somewhere in the French alps with 
 a BIG whiteboard...

If there is enough snow, make that:

riding (snow)boards over BIG white (stuff) ...

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Question - Re: cvs commit: DefaultCMSetter.java

2001-03-16 Thread Arieh Markel

Just a question ...

 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/context 
DefaultCMSetter.java
 
 marcsaeg01/03/16 16:26:44
 
   Modified:src/share/org/apache/tomcat/context Tag: tomcat_32
 DefaultCMSetter.java
   Log:
   Use the default locale for generated error pages.
   
   Reported by [EMAIL PROTECTED] (Yoshiyuki Karezaki).
   
   PR:  691
   Submitted by:   Kazuhiro Kazama
   
   Revision  ChangesPath
   No   revision
   
   
   No   revision
   
   
   1.45.2.9  +20 -4 
jakarta-tomcat/src/share/org/apache/tomcat/context/Attic/DefaultCMSetter.java
   
   Index: DefaultCMSetter.java
   ===
   RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/Attic/DefaultCMSe
tter.java,v
   retrieving revision 1.45.2.8
   retrieving revision 1.45.2.9
   diff -u -r1.45.2.8 -r1.45.2.9
   --- DefaultCMSetter.java2000/11/11 02:56:57 1.45.2.8
   +++ DefaultCMSetter.java2001/03/17 00:26:39 1.45.2.9
   @@ -151,7 +151,11 @@
public void doService(Request req, Response res)
   throws Exception
{
   -   res.setContentType("text/html");// ISO-8859-1 default


Shouldn't the charset be according to the Locale and Charset of the
request that was passed ?

Arieh


   +   String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
   +   if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
   +   res.setContentType("text/html");
   +   else
   +   res.setContentType("text/html; charset=" + charset);

   String requestURI = (String)req.
   getAttribute("javax.servlet.include.request_uri");
   @@ -226,7 +230,11 @@
   return;
   }

   -   res.setContentType("text/html");
   +   String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
   +   if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
   +   res.setContentType("text/html");
   +   else
   +   res.setContentType("text/html; charset=" + charset);
   res.setStatus( 500 );
   
   StringBuffer buf = new StringBuffer();
   @@ -331,7 +339,11 @@
   String msg=(String)req.getAttribute("javax.servlet.error.message");
   String errorURI = res.getErrorURI();
   
   -   res.setContentType("text/html");
   +   String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
   +   if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
   +   res.setContentType("text/html");
   +   else
   +   res.setContentType("text/html; charset=" + charset);
   // res is reset !!!
   // status is already set
   int sc=res.getStatus();
   @@ -432,7 +444,11 @@

   if( debug0) ctx.log("Redirect " + location + " " + req );

   -   res.setContentType("text/html");// ISO-8859-1 default
   +   String charset = LocaleToCharsetMap.getCharset(Locale.getDefault());
   +   if (charset == null || charset.equalsIgnoreCase("ISO-8859-1"))
   +   res.setContentType("text/html");
   +   else
   +   res.setContentType("text/html; charset=" + charset);
   res.setHeader("Location", location);

   StringBuffer buf = new StringBuffer();
   
   
   

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Pray for snow  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Clarification on Catalina TODO item: CGI emulation servlet

2001-02-20 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: Martin T Dengler [EMAIL PROTECTED]
 User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; 0.7) Gecko/20010109
 To: [EMAIL PROTECTED]
 Subject: Re: Clarification on Catalina TODO item: CGI emulation servlet
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 Craig R. McClanahan wrote:
 
  That was exactly the original thinking -- create a servlet that would be 
able
  to execute external applications in conformance with the CGI spec 
requirements
  (principally related to environment variables, and connecting standard input
  and output of the application program to the request and response streams
  appropriately.
 
 Excellent.  I suppose the right thing to do now is propose a design to 
 this list with specification references for review.  If that is too 
 heavyweight I can just run the code by somebody (you, Craig?) after 
 testing on my own Catalina build.
 
  Having this functionality implemented as a servlet means that you can map it 
to
  a directory path ("/cgi-bin/*") and/or a filename extension ("*.cgi"), in 
the
  same way that you would do so in a web server.  Or, in a security conscious
  environment, you could just remove the mappings to make CGI service
  unavailable.
 
 Exactly, and I suppose the directory path w/could obviously be web 
 app-specific, giving the normal encapsulation benefits.
 Would there be any scope for extra web-app-related information being 
 available in the spawned-process' environment, so it (the CGI) could 
 figure out the context path, etc.?

I am wondering if this will result on creating cgi-emulation
servlets that result in being platform-specific (initially, because of
the need of adapting differently to the manner in which the host's
environment variables need to be set, establishment of PATH,
probably there is more), or operate in a platform-specific manner.

(I am not aware of a Java API that allows to modify the external - host -
environment).


Arieh

 
 
  That would be great!  I will sign you up for that item.
 
 Thanks, I look forward to helping out; if I do something wrong please 
 let me know.
 
  
  Craig McClanahan
  
 
 
 Chrs,
 Martin
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


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




Re: Bugzilla categories

2001-02-05 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: [EMAIL PROTECTED]
 X-Sender: costin@costin
 To: [EMAIL PROTECTED]
 Subject: Bugzilla categories
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 Hi,
 
 What about another category - "Encoding" for all encoding-related bugs ?
 ( that would include all "special chars", charsets, etc). It's a big
 issue and I want to have all the related bugs grouped togheter.

I think that 'i18n' would be more appropriate.

Arieh

 
 ( I'll work on them - but it's not easy and will take few weeks to sort it
 out )
 
 -- 
 Costin
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


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




String/StringBuffer (was Re: An alternative to JSP)

2001-01-26 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: Paul Speed [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: An alternative to JSP
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 
 
 
 Mel Martinez wrote:
  
  Without getting into the larger issue, one problem
  that jumped out at me from your article is (at least
  in your examples) the MLS precompile looks at the
  expression inside the digraphs and replaces line
  terminations in the *.j source with linefeed
  characters ('\n').  That presumes the line termination
  character of choice for the output is a linefeed
  character.  It may be a '\n' is fine for most cases,
  but the truth is that it depends on the platform upon
  which the output is to be used.  In generall, it is
  always best to use the line.separator property instead
  or use a PrintWriter's println() method to insert the
  correct line termination.
  
  Another issue is that the example creates catenated
  String literals.  I would hope that the actual code
  produced would use appropriately initialized
  StringBuffers or performance could be a problem.
 
   Just thought that I would point out that: 
 "My " + "dog " + "has " + "fleas." will be compiled as one String:
 "My dog has fleas." and incurs no runtime penalties.  In the case

Paul,

Actually, my investigations in the past have shown that (at least in
Sun's JDK 1.2) this is implemented as:

new StringBuffer ("My").append("dog").append("has").append("fleas").toString();

It is also possible to write a statement like:

"My" + "dog" + '.'

The ability to concatenate a char points at an underlying StringBuffer
implementation, which supports append(String) and append(char) methods.


Last paragraph in the java.lang.String javadoc says:

The Java language provides special support for the string concatentation operator
( + ), and for conversion of other objects to strings. String concatenation is
implemented through the StringBuffer class and its append method. String
conversions are implemented through the method toString, defined by Object and
inherited by all classes in Java. For additional information on string concatenation
and conversion, see Gosling, Joy, and Steele, The Java Language Specification. 



Arieh

 of literals it can be more efficient than StringBuffer as long as
 they are grouped together as above.  Since I haven't looked at the
 code directly, I don't know how or if this affects your point.
 
   -Paul Speed
 
  
  Just some thoughts on the implementation.  On the
  larger issue of this thread, I don't really see the
  benefit of something like MLS over JSP, which
  potentially allows you to completely remove all Java
  code from the html (by using jsp tags and taglibs),
  but take that as an imho.
  
  Dr. Mel Martinez
  Software Architect
  G1440, Inc.
  [EMAIL PROTECTED]
  
  --- Brad Cox [EMAIL PROTECTED] wrote:
   At 11:30 AM -0500 01/11/2001, Shawn McMurdo wrote:
   I agree with most of your discussion of the
   disadvantages of JSP/ASP/etc,
   but I believe your solution does not address a
   fundamental problem, which
   is the complete separation of presentation
   resources from presentation logic.
  
   That is correct. My goal at this point is to get
   free of JSP so the
   goal was only to duplicate what JSP does in a way I
   can live with.
  
   Having the HTML embedded in a java class may be
   suitable for small
   applications
   built by engineers but does not address the vast
   majority of applications
   where designers work on HTML using many different
   HTML editing tools
   while developers work on the application logic in
   Java using various IDEs and
   editors.
  
   Perhaps I miscommunicated. The private methods that
   contain the
   {{html}} need not be private methods in the
   controller class,
   although that is the style I demonstrated in the
   paper and that I use
   in my own I-do-it-all work.
  
   Also there is nothing that requires these view
   methods to contain
   hardcoded strings, other than the crude measurements
   in the
   Conclusion section that makes me doubt that the
   space issue is a
   primary concern. Each method could aim MLS at an
   html file at runtime
   (using the doStream() method that it provides for
   this purpose but
   which I didn't mention in the article) and let it do
   the executable
   inclusion at runtime. But good point; I'll make this
   explicit in the
   article.
  
   This would also eliminate the need for the outermost
   enclosing {{...}}, but
   the executable inclusion brackets would remain. Do
   you object to my
   belief that html experts and their tools couldn't be
   trained to
   ignore the {{...}} wrappe

RE: String/StringBuffer (was Re: An alternative to JSP)

2001-01-26 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: RE: String/StringBuffer (was Re: An alternative to JSP)
 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
 X-MIME-Autoconverted: from quoted-printable to 8bit by amon.Central.Sun.COM id 
KAA15483
 
  Last paragraph in the java.lang.String javadoc says:
  
  The Java language provides special support for the string 
  concatentation operator
  ( + ), and for conversion of other objects to strings. String 
  concatenation is
  implemented through the StringBuffer class and its append 
  method. String
  conversions are implemented through the method toString, 
  defined by Object and
  inherited by all classes in Java. For additional information 
  on string concatenation
  and conversion, see Gosling, Joy, and Steele, The Java 
  Language Specification. 
 
 And the Java Language Specification (Section 3.10.5: String Literals) says
 this:
 
 "Strings computed by constant expressions (15.27) are computed at compile
 time and then treated as if they were literals"
 
 http://java.sun.com/docs/books/jls/html/3.doc.html#101083
 
 
 Just thought that I would point out that: 
   "My " + "dog " + "has " + "fleas." will be compiled as one String:
   "My dog has fleas." and incurs no runtime penalties.  In the case
  
  Paul,
  
  Actually, my investigations in the past have shown that (at least in
  Sun's JDK 1.2) this is implemented as:
  
  new StringBuffer 
  ("My").append("dog").append("has").append("fleas").toString();
 
 If this is actually the case, Sun's JDK is not in compliance with the spec.
 However, in my tests, this is not the case. 
 
 From this class: 
 
 public class StringTest {
   static String blah = "My " + "dog " + "has " + "fleas.";
 }
 
 The following is the result from "javap -c StringTest" after compiling:
 
 Compiled from StringTest.java
 public class StringTest extends java.lang.Object {
 static java.lang.String blah;
 static {};
 public StringTest();
 }
 
 Method static {}
0 ldc #1 String "My dog has fleas."
2 putstatic #5 Field java.lang.String blah
5 return
 
 Method StringTest()
0 aload_0
1 invokespecial #4 Method java.lang.Object()
4 return
 
 

Michael,

thanks. I stand corrected.

Arieh

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

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


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




Re: [SECURITY] Security Vulnerabilities in Tomcat 3.1 and 3.2

2000-12-12 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
 Subject: Re: [SECURITY] Security Vulnerabilities in Tomcat 3.1 and 3.2
 From: Jon Stevens [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
 
 on 12/11/2000 5:59 PM, "Craig R. McClanahan" [EMAIL PROTECTED]
 wrote:
 
  I'm certainly game to remove 3.1 once we know that 3.1.1 doesn't introduce any
  nasty
  problems, but just removing 3.1 doesn't help all the thousands of people who
  have
  apps running on 3.1 and who cannot, for various reasons, immediately upgrade.
 
 They can upgrade to 3.1.1 but not 3.2? Huh?

Yes, that is actually the situation.

I can tell you that in our application, the changes implied by moving from
3.1 to 3.2 were significant (we use Tomcat in an embedded manner, dynamically
incorporating servlets to contexts), mainly because there were implementation
differences in the APIs (for Contexts, facades, etc).

 
 No, make people upgrade to 3.2. There are WAY to many advantages to having
 3.2.

We cannot 'make people upgrade'. There are organizations that rely on
a certain revision of the software. The decision of upgrading or not is not
only hinged on the advantages but in the drawbacks (the time to regression-test
that the application still functions, the time to spend to verify that the
change is 'transparent', etc), therefore, there are going to be users that
will not upgrade to 3.2 but will be willing to move to 3.1.1.

I would argue that a move from 3.1 to 3.1.1 falls into the category of
transparent move, while not being able to say the same of moving from 3.1
to 3.2.

Arieh
 
 -jon
 
 -- 
 Honk if you love peace and quiet.
 

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request SimpleMapper1.java StaticInterceptor.java

2000-12-12 Thread Arieh Markel

The fix is incorrect.

indexOf returns -1 when the substring is not found, not 0.

The way the current code is set forces wrong behavior.

It should be:

(relativePath.indexOf("/META-INF/") != -1) ||
(relativePath.indexOf("/WEB-INF/") != -1))

Arieh

 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Delivered-To: [EMAIL PROTECTED]
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request 
SimpleMapper1.java 
StaticInterceptor.java
 
 craigmcc00/12/11 09:52:31
 
   Modified:src/share/org/apache/tomcat/request Tag: tomcat_32
 SimpleMapper1.java StaticInterceptor.java
   Log:
   Fix a security vulnerability that would display the contents of sensitive
   files when a URL like this was used:
   
   http://localhost:8080/examples//WEB-INF/web.xml
   
   This vulnerability appears on Linux (and any other OS that ignores "//" in
   the middle of a pathname), but not on Windows.
   
   Submitted by: Ramon Cacha [EMAIL PROTECTED]
   PR: BugRat Bug Report #565
   
   Revision  ChangesPath
   No   revision
   
   
   No   revision
   
   
   1.15.2.4  +2 -2  
jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java
   
   Index: SimpleMapper1.java
   ===
   RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java,v
   retrieving revision 1.15.2.3
   retrieving revision 1.15.2.4
   diff -u -r1.15.2.3 -r1.15.2.4
   --- SimpleMapper1.java  2000/12/01 03:00:41 1.15.2.3
   +++ SimpleMapper1.java  2000/12/11 17:52:30 1.15.2.4
   @@ -343,8 +343,8 @@
requestURI.substring(contextPath.length()).toUpperCase();
if (relativePath.equals("/META-INF") ||
relativePath.equals("/WEB-INF") ||
   -relativePath.startsWith("/META-INF/") ||
   -relativePath.startsWith("/WEB-INF/"))
   +(relativePath.indexOf("/META-INF/") != 0) ||
   +(relativePath.indexOf("/WEB-INF/") != 0))
return 404;

   return OK;
   
   
   
   1.7.2.5   +3 -1  
jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java
   
   Index: StaticInterceptor.java
   ===
   RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java,v
   retrieving revision 1.7.2.4
   retrieving revision 1.7.2.5
   diff -u -r1.7.2.4 -r1.7.2.5
   --- StaticInterceptor.java  2000/11/07 22:52:52 1.7.2.4
   +++ StaticInterceptor.java  2000/12/11 17:52:30 1.7.2.5
   @@ -418,7 +418,9 @@

   String relPathU=relPath.toUpperCase();
   if ( relPathU.startsWith("WEB-INF") ||
   -   relPathU.startsWith("META-INF")) {
   + relPathU.startsWith("META-INF") ||
   +(relPathU.indexOf("/WEB-INF/") != 0) ||
   +    (relPathU.indexOf("/META-INF/") != 0) ) {
   return null;
   }
   }
   
   
   

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Problem to limit the number of connections

2000-12-08 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Delivered-To: moderator for [EMAIL PROTECTED]
 From: Sophie Lemonnier [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Problem to limit the number of connections
 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
 
 Hello,
 
 I have a machine with little ressouces and with other applications than
 tomcat are running.
 Consequently, I would like to prevent too many clients to connect to
 tomcat...
 I haven't managed yet to limit the number of connections
 Can anyone help me?

Sophie,

you did not mention the version of Tomcat that you are using.

In any case, I believe that for 3.2, the solution is in properties for the
org.apache.tomcat.service.PoolTcpConnector class:

the properties below control the number of threads (which will be associated
with inbound socket connections) that the connector has.

public static final String THREAD_POOL = "thread_pool";
public static final String MAX_THREADS = "max_threads";
public static final String MAX_SPARE_THREADS = "max_spare_threads";
public static final String MIN_SPARE_THREADS = "min_spare_threads";

What you need to do is modify your server.xml to explicitly set the
property values that are appropriate for you:

(Here is an example from an old server.xml I was using)

Connector className="org.apache.tomcat.service.PoolTcpConnector"
Parameter name="handler"
value="org.apache.tomcat.service.http.HttpConnectionHandler"/
Parameter name="port" value="8180"/
Parameter name="thread_pool" value="on"/
Parameter name="max_threads" value="100"/
Parameter name="max_spare_threads" value="30"/
Parameter name="min_spare_threads" value="10"/
/Connector

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Improvement to Bugrat ?

2000-12-07 Thread Arieh Markel

I am wondering how difficult would be to change bugrat so that
the synopsis (or part of it) appears on the mail subject line.

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: BugRat Report #543 has been filed.

2000-12-07 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: BugRat Mail System [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: BugRat Report #543 has been filed.
 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
 
 Bug report #543 has just been filed.
 
 You can view the report at the following URL:
 
http://znutar.cortexity.com/BugRatViewer/ShowReport/543
 
 REPORT #543 Details.
 
 Project: Tomcat
 Category: Bug Report
 SubCategory: New Bug Report
 Class: swbug
 State: received
 Priority: high
 Severity: critical
 Confidence: public
 Environment: 
Release: 3.2 Final
JVM Release: Sun JDK 1.3.0-C
Operating System: NT4
OS Release: SP5
Platform: intel
 
 Synopsis: 
 calling getServletContext().getRequestDispatcher() always returns null
 
 Description:
 Making a call to:
 getServletContext().getRequestDispatcher("http://www.google.com/")
 
 with any string, always returns null;

Follows the javadoc for getRequestDispatcher().

What can be seen is that it explicitly says that the path must
begin with a "/", and your usage does not.

The javadoc does not say that you can pass any URL as an argument.

From the implementation perspective, if what you want to do is
perform a redirection to a URL outside your tomcat servlet container,
RequestDispatcher redirection is not what you need to do.
You should probably do location redirect.

response.setHeader("Location", url);


Here is the javadoc.


public RequestDispatcher getRequestDispatcher(java.lang.String path)

 Returns a RequestDispatcher object that acts as a wrapper for the resource located
 at the given path. A RequestDispatcher object can be used to forward a request to
 the resource or to include the resource in a response. The resource can be 
dynamic or
 static. 

 The pathname must begin with a "/" and is interpreted as relative to the current
 context root. Use getContext to obtain a RequestDispatcher for resources in
 foreign contexts. This method returns null if the ServletContext cannot return a
 RequestDispatcher.
 Parameters:
 path - a String specifying the pathname to the resource
 Returns:
 a RequestDispatcher object that acts as a wrapper for the resource at the
 specified path
 See Also: 
 RequestDispatcher, getContext(java.lang.String)


Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Proposal: new commiter

2000-12-05 Thread Arieh Markel


 
 Hi,
 
 Please vote for Dan Milstein as a new commiter for tomcat.

+1

Arieh

 
 Dan did an excelent review of the connector code, documented the protocol,
 proposed many enhancements and re-factored the Ajp13 adapter. 
 
 We are very lucky to have someone who is interested in this difficult
 area and continues the great work that Gal Shachor started.
 
 Thanks,
 Costin

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Re: Problem with context initialization ?

2000-11-21 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: [EMAIL PROTECTED]
 X-Sender: costin@costin
 To: [EMAIL PROTECTED], Arieh Markel [EMAIL PROTECTED]
 Subject: Re: Problem with context initialization ?
 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
 
 Hi Arieh,
 
 I know about this problem, and 3.3 is going to fix this ( and other
 similar problems ) by defining a startup order and changing the code 
 to implement it.
 
 I don't know any simple fix for 3.2, there is a lot of code that has to be
 changed.

Luckily, as you can see from the stack trace, the exception is caused
inside of a base class that we have defined (CMCServlet), when trying to access
a static method in another class that we have defined (ServerUtils).

I believe I should be able to catch the NoClassDefFoundError at the
appropriate time.

I am trying to find out what are the actions that I may take to correct
the problem when catching the error.

In essence, what in the API is there to perhaps force a reload/re-init
of the Context that is giving me the problem.

Any ideas ?

Arieh

 
 Costin 
 
 On Mon, 20 Nov 2000, Arieh Markel wrote:
 
  We are running into the following problem:
  
  . we start Tomcat in an embedded manner:
  
  use a server.xml that only includes interceptors and connectors
  
  create contexts programmatically
  
  initialize the context manager
  
  
  I am observing the following behavior:
  
the tomcat is making the ports available before the context finished
being initialized.

On trying to access the application at that time, we get the following  
  
  java.lang.NoClassDefFoundError: com/sun/esm/web/server/ServerUtils
  at com.sun.esm.web.servlet.CMCServlet.service(CMCServlet.java:354)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at 
  org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
  at org.apache.tomcat.core.Handler.service(Handler.java:263)
  at 
  org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
  at 
  
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:787)
  at 
  org.apache.tomcat.core.ContextManager.service(ContextManager.java:733)
  at 
  
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConne
  ctionHandler.java:210)
  at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
  at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled 
Code)
  at java.lang.Thread.run(Compiled Code)
  
   
From that moment on, we are never able to access the webserver, getting
the same message again and again.

  -
  
  It appears that there is a race condition on the ContextManager.start()
  method.
  
  I instrumented my context manager startup to print when the return
  from ContextManager.start occurs.
  
  I try to access my initial page (which is actually a servlet)
  repeatedly from a browser trying to catch the point in time where
  the connector is made available by the contexts are not.
  
  When I manage to access the port on the connector
  the result is the above exception.
  
  Does anybody else see something similar ?
  
  -
  
  Arieh   
  --
   Arieh Markel   Sun Microsystems Inc.
   Network Storage500 Eldorado Blvd. MS UBRM11-194
   e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
   Let's go Panthers  Phone: (303) 272-8547 x78547
   (e-mail me with subject SEND PUBLIC KEY to get public key)
  

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Problem with context initialization ?

2000-11-20 Thread Arieh Markel

We are running into the following problem:

. we start Tomcat in an embedded manner:

use a server.xml that only includes interceptors and connectors

create contexts programmatically

initialize the context manager


I am observing the following behavior:

  the tomcat is making the ports available before the context finished
  being initialized.
  
  On trying to access the application at that time, we get the following  

java.lang.NoClassDefFoundError: com/sun/esm/web/server/ServerUtils
at com.sun.esm.web.servlet.CMCServlet.service(CMCServlet.java:354)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
at org.apache.tomcat.core.Handler.service(Handler.java:263)
at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:787)
at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:733)
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConne
ctionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)

 
  From that moment on, we are never able to access the webserver, getting
  the same message again and again.
  
-

It appears that there is a race condition on the ContextManager.start()
method.

I instrumented my context manager startup to print when the return
from ContextManager.start occurs.

I try to access my initial page (which is actually a servlet)
repeatedly from a browser trying to catch the point in time where
the connector is made available by the contexts are not.

When I manage to access the port on the connector
the result is the above exception.

Does anybody else see something similar ?

-

Arieh   
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)




Interesting issue with Java and Cygwin under WIN32

2000-11-15 Thread Arieh Markel

We have identified an interesting issue, which I am not sure how to
resolve (if it ever will), and it is not directly relevant to Jakarta.

In our application, in order to leverage the work that has been done
for operating in a Unix environment (rcX.d scripts, utility scripts),
we have decided to use Cygwin to provide a similar environment when
working on a Win32 environment.

What it interesting to note is that we find problems with platform
dependent Java items (like fileSeparator, pathSeparator), which take
it from the host environment and prevent from setting it up externally.

In fact, I would like the ability to override the Win32 default in a
CygWin environment.

Any ideas ?

Opinions ?

Thanks,

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


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




Re: Servlet - Jini - Tomcat3.1

2000-11-15 Thread Arieh Markel


 From: "Flávio Rodrigo M. de Carvalho" [EMAIL PROTECTED]
 To: "Arieh Markel" [EMAIL PROTECTED], 
[EMAIL PROTECTED]
 Subject: Re: Servlet - Jini - Tomcat3.1
 
 - Original Message -
 Flavio,
 It is not clear from your description what you are trying to do.
 
   . does your server issue a query to obtain a Jini service reference from
  a lookup server ?
 
 Exactly, my servlet just make an unicast to receive from the lookup server
 the Registrar (LookupLocator.GETREGISTRAR) . The exception appears after
 that call.
 If it helps, I am trying to connect a servlet to a JavaSpace and
 TransactionManager (mahalo) services.
 
 
. are you expecting that the Jini service will upload the WAR over
  the net to be incorporated ?
 
 This I didn't understand... (???)

The fact that an exception of casting happens on a class expected to be 
WARConnection leads me to believe that the code you have is expecting to
have a 'war' file downloaded from over the network.

So my question is if what you intended to do is the following:

  . access an object from the JavaSpace and have that object become/incorporate
a web-application to the Tomcat container

I really can't see how there is a relationship between the Jini Lookup
invocation and the exception thrown.

I wonder if you could post the code (the method) in which this happens.

Arieh


 
 Arieh
 
 
 
 

--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


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




Re: About Form-Login-Config

2000-11-10 Thread Arieh Markel


 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Craig, Costin,

thanks for your response.


 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 From: "Craig R. McClanahan" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: About Form-Login-Config
 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
 
 Arieh Markel wrote:
 
  I am reading the (2.3) spec and am realizing that I am not able to
  share a login page with multiple contexts.
 
 
 That's true (also true for servlet 2.2).
 
 
  In our (embedded) use of Tomcat, we have different contexts, but
  we use a single login form/screen.
 
  When configuring the web.xml for those contexts, I realize that there is
  no way to have a successful form-login-page without it belonging to the
  same context.
 
  In our case, the login form is actually a servlet that belongs to the
  default context.
 
  I was hoping to be able to point at that (default context /login)
  servlet from the other contexts.
 
  One of the solutions could be to define a /login (the same) servlet
  on all the various contexts.
 
  (I will mention that I am defining my contexts as 'trusted').
  (Another note: I am using 3.2)
 
  If I do what mention in the last paragraph, I will end up with having
  three different instances of the login servlet, right ?
 
 
 Yes, assuming you have three contexts.
 
 But that isn't going to be the worst of it -- a user's identity does not
 propogate across web apps either, so a user that is using all three contexts
 will have to authenticate themselves to all three web apps.

I have resolved the authentication issue by sharing the session information
among the servlets of the different contexts (this was done by providing
some utility Java classes that are to be taken advantage by those
who develop our servlets - I admit that the solution is not generic, as
it implies that the servlets are aware of those utility classes).

There is always a single authentication, using the login servlet of the
default context.

On the non-default contexts, I opted to define a login page that performs
a redirection to the login servlet in the default context.

 
 
  --
 
  An alternate approach could be to define 'login.html' files in those
  contexts, and to have that file perform a Location redirect to the
  default-context /login servlet.
 
 
 Won't that cause the user to log in only to the default context?

Yes, but I don't care that it is the case, because the non-default context 
servlets are always reached from the login context.



The division of contexts is not so much to define segregated separate
web applications, as much as a cleaner way to separate between three
pieces of the application that we develop.

The first piece is the 'static' piece of our application, while the
second piece is a 'dynamic' piece, which is populated based on information
about objects discovered in the network.

(A third piece is a JavaHelp context - on which we put a single servlet,
that can access a JavaHelp document repository).



 
 
  --
 
  I am wondering about the reasons that may have forced the definition
  of a context-relative login-form as opposed to allowing a URL to be
  specified.
 
 
 The reasoning for this was the same as the reasoning for everything else in
 a web-app being context relative.  The whole idea is that a web application
 should be a stand alone entity, able to be deployed on *any* server that
 supports the required API levels, without external dependencies.
 
 The "escape valve" for cross-app authentication that the servlet spec
 provides is the notion of supporting "single sign on" (Servlet 2.2, section
 11.6, and Servlet 2.3 PFD, section 12.6).  The basic idea is that a user
 authenticates himself or herself to the first app in which they try to
 access a protected page, and then this identity is remembered across all the
 other apps running in the same server.
 
 Unfortunately for your particular requirements :-(, none of the Tomcat 3.x
 versions support this feature -- although Tomcat 4.0 does.

I guess I must have implemented it in our application ;).

Arieh
--
 Arieh Markel   Sun Microsystems Inc.
 Network Storage500 Eldorado Blvd. MS UBRM11-194
 e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
 Let's go Panthers  Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


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