cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade HttpSessionFacade.java

2001-08-31 Thread costin

costin  01/08/31 20:20:55

  Modified:src/facade22/org/apache/tomcat/facade HttpSessionFacade.java
  Log:
  Ops, debug should be 0, not 10.
  
  Thanks Larry.
  
  Revision  ChangesPath
  1.12  +1 -1  
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpSessionFacade.java
  
  Index: HttpSessionFacade.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpSessionFacade.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- HttpSessionFacade.java2001/09/01 01:59:30 1.11
  +++ HttpSessionFacade.java2001/09/01 03:20:55 1.12
  @@ -291,7 +291,7 @@
}
   }
   
  -private static final int dL=10;
  +private static final int dL=0;
   private void d(String s ) {
System.err.println( "HttpSessionFacade: " + s );
   }
  
  
  



cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade HttpSessionFacade.java

2001-08-31 Thread costin

costin  01/08/31 18:59:30

  Modified:src/facade22/org/apache/tomcat/facade HttpSessionFacade.java
  Log:
  session.invalidate() should remove the attributes, do the callbacks and recycle the 
session.
  
  Revision  ChangesPath
  1.11  +10 -0 
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpSessionFacade.java
  
  Index: HttpSessionFacade.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpSessionFacade.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HttpSessionFacade.java2001/07/10 23:56:33 1.10
  +++ HttpSessionFacade.java2001/09/01 01:59:30 1.11
  @@ -153,6 +153,10 @@
   public void invalidate() {
checkValid();
realSession.getTimeStamp().setValid( false );
  + // remove all attributes
  + if( dL > 0 ) d("Invalidate " + realSession.getId());
  + realSession.setState(ServerSession.STATE_EXPIRED);
  + realSession.recycle();
   }
   
   /**
  @@ -287,4 +291,10 @@
}
   }
   
  +private static final int dL=10;
  +private void d(String s ) {
  + System.err.println( "HttpSessionFacade: " + s );
  +}
  +
  +
   }
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Ajp13.java

2001-08-31 Thread keith

keith   01/08/31 18:53:25

  Modified:src/native/mod_jk/apache1.3 mod_jk.c
   src/native/mod_jk/common jk_ajp13_worker.c jk_service.h
jk_util.c
   src/share/org/apache/tomcat/modules/server Ajp13.java
  Log:
  Upgrade mod_jk to support chunked input from Apache 1.3.
  TODO: port to Apache 2.0 module. (And forward port to j-t-c)
  
  Revision  ChangesPath
  1.10  +22 -11jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c
  
  Index: mod_jk.c
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- mod_jk.c  2001/06/01 08:41:13 1.9
  +++ mod_jk.c  2001/09/01 01:53:25 1.10
  @@ -267,16 +267,19 @@
   if(s && s->ws_private && b && actually_read) {
   apache_private_data_t *p = s->ws_private;
   if(!p->read_body_started) {
  -if(!ap_setup_client_block(p->r, REQUEST_CHUNKED_DECHUNK)) {
  -if(ap_should_client_block(p->r)) { 
  -p->read_body_started = JK_TRUE; 
  -}
  +if(ap_should_client_block(p->r)) { 
  +p->read_body_started = JK_TRUE; 
   }
   }
   
  -if(p->read_body_started) {
  -*actually_read = ap_get_client_block(p->r, b, len);
  -return JK_TRUE;
  +if(p->read_body_started) {
  + long rv;
  + if ((rv = ap_get_client_block(p->r, b, len)) < 0) {
  + *actually_read = 0;
  + } else {
  + *actually_read = (unsigned) rv;
  + }
  +return JK_TRUE;
   }
   }
   return JK_FALSE;
  @@ -454,7 +457,9 @@
   s->server_software = (char *)ap_get_server_version();
   
   s->method   = (char *)r->method;
  -s->content_length = get_content_length(r);
  +s->content_length = get_content_length(r);
  +s->is_chunked   = r->read_chunked;
  +s->no_more_chunks = 0;
   s->query_string = r->args;
   s->req_uri  = r->uri;
   
  @@ -784,10 +789,16 @@
   {   
   /* Retrieve the worker name stored by jk_translate() */
   const char *worker_name = ap_table_get(r->notes, JK_WORKER_ID);
  +int rc;
   
   if(r->proxyreq) {
   return HTTP_INTERNAL_SERVER_ERROR;
  -}
  +}
  +
  +/* Set up r->read_chunked flags for chunked encoding, if present */
  +if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) {
  + return rc;
  +}
 
   if(worker_name) {
   jk_server_conf_t *conf =
  @@ -820,12 +831,12 @@
 l, 
 &is_recoverable_error);
   
  -if (s.content_read < s.content_length) {
  +if (s.content_read < s.content_length || s.is_chunked) {
   /*
* If the servlet engine didn't consume all of the
* request data, consume and discard all further
* characters left to read from client 
  - */
  + */
   char *buff = ap_palloc(r->pool, 2048);
   if (buff != NULL) {
   int rd;
  
  
  
  1.11  +40 -21jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c
  
  Index: jk_ajp13_worker.c
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_ajp13_worker.c 2001/08/23 15:41:20 1.10
  +++ jk_ajp13_worker.c 2001/09/01 01:53:25 1.11
  @@ -263,6 +263,10 @@
 unsigned len)
   {
   unsigned rdlen = 0;
  +
  +if (s->is_chunked && s->no_more_chunks) {
  + return 0;
  +}
   
   while(rdlen < len) {
   unsigned this_time = 0;
  @@ -270,45 +274,60 @@
   return -1;
   }
   
  -if(0 == this_time) {
  +if(0 == this_time) {
  + if (s->is_chunked) {
  + s->no_more_chunks = 1; /* read no more */
  + }
   break;
   }
  - rdlen += this_time;
  +rdlen += this_time;
   }
   
   return (int)rdlen;
   }
  -
  +
  +/* Returns -1 on error, else number of bytes read */
   static int read_into_msg_buff(ajp13_endpoint_t *ep,
 jk_ws_service_t *r, 
 jk_msg_buf_t *msg, 
 jk_logger_t *l,
 unsigned len)
   {
  -unsigned char *read_buf = jk_b_get_buff(msg);   
  

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

2001-08-31 Thread costin

costin  01/08/31 17:57:17

  Modified:src/share/org/apache/tomcat/core Request.java
  Log:
  Cosmetic - use the factory instead of new for MessageBytes.
  
  Revision  ChangesPath
  1.111 +12 -12jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- Request.java  2001/08/29 05:01:24 1.110
  +++ Request.java  2001/09/01 00:57:16 1.111
  @@ -145,23 +145,23 @@
   // MB are also used for headers - it allows lazy
   // byte->char conversion so we can add the encoding
   // that is known only after header parsing. Work in progress.
  -protected MessageBytes schemeMB=new MessageBytes();
  +protected MessageBytes schemeMB=MessageBytes.newInstance();
   
   // uri without any parsing performed
  -protected MessageBytes unparsedURIMB=new MessageBytes();
  +protected MessageBytes unparsedURIMB=MessageBytes.newInstance();
   
  -protected MessageBytes methodMB=new MessageBytes();
  -protected MessageBytes uriMB=new MessageBytes();
  -protected MessageBytes queryMB=new MessageBytes();
  -protected MessageBytes protoMB=new MessageBytes();
  +protected MessageBytes methodMB=MessageBytes.newInstance();
  +protected MessageBytes uriMB=MessageBytes.newInstance();
  +protected MessageBytes queryMB=MessageBytes.newInstance();
  +protected MessageBytes protoMB=MessageBytes.newInstance();
   // uri components
  -protected MessageBytes contextMB=new MessageBytes();
  -protected MessageBytes servletPathMB=new MessageBytes();
  -protected MessageBytes pathInfoMB=new MessageBytes();
  +protected MessageBytes contextMB=MessageBytes.newInstance();
  +protected MessageBytes servletPathMB=MessageBytes.newInstance();
  +protected MessageBytes pathInfoMB=MessageBytes.newInstance();
   
   // remote address/host
  -protected MessageBytes remoteAddrMB=new MessageBytes();
  -protected MessageBytes remoteHostMB=new MessageBytes();
  +protected MessageBytes remoteAddrMB=MessageBytes.newInstance();
  +protected MessageBytes remoteHostMB=MessageBytes.newInstance();
   
   // GS, used by the load balancing layer in the Web Servers
   // jvmRoute == the name of the JVM inside the plugin.
  @@ -181,7 +181,7 @@
   protected MessageBytes contentTypeMB=null;
   //protected String contentType = null;
   protected String charEncoding = null;
  -protected MessageBytes serverNameMB=new MessageBytes();
  +protected MessageBytes serverNameMB=MessageBytes.newInstance();
   
   // auth infor
   protected String authType;
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/session SimpleSessionStore.java

2001-08-31 Thread costin

costin  01/08/31 17:56:37

  Modified:src/share/org/apache/tomcat/modules/session
SimpleSessionStore.java
  Log:
  A tiny improvement in session reloading, objects that implement valueUnbound but can 
be
  serialized will not be unbounded, but preserved.
  
  Sessions will be recycled after EXPIRE state is 'stable' ( i.e. all modules complete 
all the
  associated hooks).
  
  Set debug on new sessions based on our own debug level - so setting debug="1" on the
  session store ( which creates and manages the session storage ) will enable debug on
  the session activities as well.
  
  Revision  ChangesPath
  1.18  +18 -4 
jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java
  
  Index: SimpleSessionStore.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SimpleSessionStore.java   2001/08/24 02:24:19 1.17
  +++ SimpleSessionStore.java   2001/09/01 00:56:37 1.18
  @@ -123,8 +123,6 @@
while( sessionEnum.hasMoreElements() ) {
ServerSession session = (ServerSession)sessionEnum.nextElement();
   
  - session.setState( ServerSession.STATE_SUSPEND, req );
  - 
ClassLoader oldLoader=(ClassLoader)ctx.getContainer().
getNote("oldLoader");
   
  @@ -144,7 +142,19 @@
newSession.put( key, newValue );
} 
}
  + // Remove all objects we know how to handle
  + e=newSession.keys();
  + while( e.hasMoreElements() )   {
  + String key = (String) e.nextElement();
  + session.removeAttribute(key);
  + }
   
  + if( debug > 0 ) log("Prepare for reloading, SUSPEND " + session );
  + // If anyone can save the rest of the attributes or at least notify
  + // the owner...
  + session.setState( ServerSession.STATE_SUSPEND, req );
  + 
  + if( debug > 0 ) log("After reloading, RESTORED " + session );
session.setState( ServerSession.STATE_RESTORED, req );
   
/* now put back all attributs */
  @@ -336,7 +346,9 @@
sessions.remove(session.getId().toString());
recycled.put(session);
session.setValid(false);
  - session.recycle();
  + // Do not recycle it yet - whoever expires it should also recyle.
  + // Otherwise we may miss something
  + // session.recycle();
//  session.removeAllAttributes();
}
   
  @@ -346,11 +358,12 @@
if (session == null) {
session = ctx.getContextManager().createServerSession();
session.setManager( this );
  + session.setDebug( debug );
}
session.setContext( ctx );
   
session.setState( ServerSession.STATE_NEW, req );
  -
  + 
// The id will be set by one of the modules
String newId=session.getId().toString();

  @@ -365,6 +378,7 @@
if( oldS!=null) {
// that's what the original code did
oldS.setState( ServerSession.STATE_EXPIRED );
  + oldS.recycle();
}
sessions.put( newId, session );
return (session);
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/session SessionId.java

2001-08-31 Thread costin

costin  01/08/31 17:53:43

  Modified:src/share/org/apache/tomcat/modules/session SessionId.java
  Log:
  More debug.
  
  I'm adding this in order to provide enough trace information for eventual problems, 
it
  helps a lot in debugging any problem and in making sure things run the way they 
should.
  
  Revision  ChangesPath
  1.14  +3 -0  
jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SessionId.java
  
  Index: SessionId.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SessionId.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- SessionId.java2001/08/17 04:03:55 1.13
  +++ SessionId.java2001/09/01 00:53:43 1.14
  @@ -182,6 +182,7 @@
sessionId= request.getRequestedSessionId();
sess=processSession( request, sessionId,
  request.getSessionIdSource() );
  + if( debug>0 ) log("CookiesFirst==false, use url rewriting " + sess );
if( sess!=null )
return 0;
}
  @@ -210,6 +211,7 @@
sessionId= request.getRequestedSessionId();
sess=processSession( request, sessionId,
  request.getSessionIdSource() );
  + if( debug>0 ) log("Url rewriting, found " + sess );
if( sess!=null )
return 0;
}
  @@ -307,6 +309,7 @@
buf.append( ";Path=" ).append(  sessionPath  );
response.addHeader( "Set-Cookie",
buf.toString());
  + if( debug>0) log( "Setting cookie " + buf );

return 0;
   }
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/session SessionExpirer.java

2001-08-31 Thread costin

costin  01/08/31 17:52:37

  Modified:src/share/org/apache/tomcat/modules/session
SessionExpirer.java
  Log:
  More debug statements, start when tomcat is starting ( no need to run expirer when 
tomcat is
  not running ).
  
  Recycle the session after expiring it.
  
  Revision  ChangesPath
  1.4   +7 -2  
jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SessionExpirer.java
  
  Index: SessionExpirer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SessionExpirer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SessionExpirer.java   2001/04/21 17:49:35 1.3
  +++ SessionExpirer.java   2001/09/01 00:52:37 1.4
  @@ -113,14 +113,14 @@
   
   // XXX use contextInit/shutdown for local modules
   
  -public void engineInit( ContextManager cm ) throws TomcatException {
  +public void engineStart( ContextManager cm ) throws TomcatException {
expirer=new Expirer();
expirer.setCheckInterval( checkInterval );
expirer.setExpireCallback( new SessionExpireCallback(this, debug) );
expirer.start();
   }
   
  -public void engineShutdown( ContextManager cm ) throws TomcatException {
  +public void engineStop( ContextManager cm ) throws TomcatException {
expirer.stop();
   }
   
  @@ -128,6 +128,7 @@
TimeStamp ts=session.getTimeStamp();
   
if( state==ServerSession.STATE_NEW ) {
  + if( debug > 0 ) log("Registering new session for expiry checks");
ts.setNew(true);
ts.setValid(true);

  @@ -139,6 +140,7 @@
   
expirer.addManagedObject( ts );
}  else if( state==ServerSession.STATE_EXPIRED ) {
  + if( debug > 0 ) log("Removing expired session from expiry checks"); 
expirer.removeManagedObject( ts );
}
return state;
  @@ -162,6 +164,9 @@
se.log( "Session expired " + sses);
}
sses.setState( ServerSession.STATE_EXPIRED );
  + // After expiring it, we clean up.
  + if( debug > 0 ) se.log( "Recycling " + sses);
  + sses.recycle();
}
   }
   }
  
  
  



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

2001-08-31 Thread costin

costin  01/08/31 17:49:22

  Modified:src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Make sure contextM is set on newly create session objects.
  
  Revision  ChangesPath
  1.191 +3 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.190
  retrieving revision 1.191
  diff -u -r1.190 -r1.191
  --- ContextManager.java   2001/08/29 05:01:24 1.190
  +++ ContextManager.java   2001/09/01 00:49:22 1.191
  @@ -1255,6 +1255,8 @@
   }
   
   public ServerSession createServerSession() {
  - return new ServerSession();
  + ServerSession ss=new ServerSession();
  + ss.setContextManager( this );
  + return ss;
   }
   }
  
  
  



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

2001-08-31 Thread costin

costin  01/08/31 17:48:48

  Modified:src/share/org/apache/tomcat/core ServerSession.java
  Log:
  Added more comments, more logging.
  
  Recycle the facade - this is important because prevents user code from "keeping" 
references to
  session objects that are reused. Since session is a long-lived object the impact on 
performance
  is minimal ( and can be avoided by pooling the facade at context level - if we want 
to ).
  
  There are 2 more changes needed to support that ( recycle() must be called _after_ 
the session
  is in EXPIRED state - various hooks in expire need access to facade, and we don't 
want to
  depend on module ordering )
  
  Revision  ChangesPath
  1.13  +40 -6 
jakarta-tomcat/src/share/org/apache/tomcat/core/ServerSession.java
  
  Index: ServerSession.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ServerSession.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ServerSession.java2001/08/17 04:02:55 1.12
  +++ ServerSession.java2001/09/01 00:48:48 1.13
  @@ -86,20 +86,38 @@
*/
   public class ServerSession {
   
  +/** Session is new. Modules can do all the preparation
  + work - set id, register it for expiration, etc
  +*/
   public static final int STATE_NEW=0;
   
  +/** The session was accessed. Nothing big.
  + */
   public static final int STATE_ACCESSED=1;
   
  +/** If you set the server session object in the
  + EXPIRED state, it'll do all the cleanup and
  + be removed from the active sessions.
  +
  + You must make sure you recycle the object
  + after setState(STATE_EXPIRED)
  +*/
   public static final int STATE_EXPIRED=2;
   
   public static final int STATE_INVALID=3;
   
  +/** The session will be prepared for suspending -
  + same as for reload. What can be preserved will be,
  + or unbind events will be generated.
  +*/
   public static final int STATE_SUSPEND=4;
   
  +/** After restart - or after reload
  + */
   public static final int STATE_RESTORED=5;
   
   private int debug=0;
  -private MessageBytes id = new MessageBytes();
  +private MessageBytes id = MessageBytes.newInstance();
   // XXX This must be replaced with a more efficient storage
   private Hashtable attributes = new Hashtable();
   
  @@ -107,6 +125,7 @@
   boolean distributable=false;
   Object manager;
   Context context;
  +ContextManager contextM;
   private Object notes[]=new Object[ContextManager.MAX_NOTES];
   private int state=STATE_NEW;
   Object facade;
  @@ -126,7 +145,10 @@
return manager;
   }
   
  -/** The web application that creates this session
  +/** The web application that creates this session.
  + *  Don't relly on this, as we may have cross-context
  + *  sessions in a future version. Used to get the session options,
  + *  represents the webapp that creates the session.
*/
   public Context getContext() {
return context;
  @@ -136,6 +158,10 @@
context=ctx;
   }
   
  +public void setContextManager( ContextManager cm ) {
  + this.contextM=cm;
  +}
  +
   public Object getFacade() {
return facade;
   }
  @@ -211,7 +237,7 @@
   }
   
   public void removeAllAttributes() {
  - if( debug > 0 ) System.out.println("ServerSession:removeAllAttributes");
  + if( debug > 0 ) contextM.log("ServerSession:removeAllAttributes");
Enumeration attrs = getAttributeNames();
while (attrs.hasMoreElements()) {
String attr = (String) attrs.nextElement();
  @@ -220,13 +246,13 @@
   }
   
   public void removeAttribute(String name) {
  - if( debug > 0 ) System.out.println("ServerSession:removeAllAttribute "+ name);
  + if( debug > 0 ) contextM.log("ServerSession:removeAllAttribute "+ name);
// Hashtable is already synchronized
attributes.remove(name);
   }
   
   public void setAttribute(String name, Object value) {
  - if( debug > 0 ) System.out.println("ServerSession:setAttribute "+ name);
  + if( debug > 0 ) contextM.log("ServerSession:setAttribute "+ name);
attributes.put(name, value);
   }
   
  @@ -243,6 +269,13 @@
   public boolean isValid() {
return getTimeStamp().isValid();
   }
  +
  +/** Display debug messages. Set by the session creator - typically the
  + *  session store ( SimpleSessionStore in 3.3 ).
  + */
  +public void setDebug(int d) {
  + debug=d;
  +}
   
   /**
* Release all object references, and initialize instance variables, in
  @@ -250,7 +283,8 @@
*/
   public void recycle() {
// Reset the instance variables associated with this Session
  - if( debug > 0 ) System.out.println("S

cvs commit: jakarta-tomcat-jasper/jasper34/runtime/org/apache/jasper34/runtime PageContextImpl.java

2001-08-31 Thread costin

costin  01/08/31 17:42:09

  Modified:jasper34/runtime/org/apache/jasper34/runtime
PageContextImpl.java
  Log:
  For the third time, updating the forward fix from Shawn on j-t-j.
  
  Revision  ChangesPath
  1.3   +3 -0  
jakarta-tomcat-jasper/jasper34/runtime/org/apache/jasper34/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper34/runtime/org/apache/jasper34/runtime/PageContextImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PageContextImpl.java  2001/06/06 06:45:34 1.2
  +++ PageContextImpl.java  2001/09/01 00:42:09 1.3
  @@ -415,6 +415,9 @@
   throws ServletException, IOException
   {
   String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  + if( out!=null ) {
  + out.clearBuffer();
  + }
   context.getRequestDispatcher(path).forward(request, response);
   }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime PageContextImpl.java

2001-08-31 Thread costin

costin  01/08/31 17:41:21

  Modified:src/share/org/apache/jasper/runtime PageContextImpl.java
  Log:
  Clear output buffer on forwarding, thanks again Shawn.
  Submitted by: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.21  +3 -0  
jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- PageContextImpl.java  2001/03/23 02:21:20 1.20
  +++ PageContextImpl.java  2001/09/01 00:41:21 1.21
  @@ -415,6 +415,9 @@
   throws ServletException, IOException
   {
   String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  + if( out!=null ) {
  + out.clearBuffer();
  + }
   context.getRequestDispatcher(path).forward(request, response);
   }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/jasper/runtime PageContextImpl.java

2001-08-31 Thread costin

costin  01/08/31 17:40:03

  Modified:src/share/org/apache/jasper/runtime Tag: tomcat_32
PageContextImpl.java
  Log:
  Clear the buffer before forwarding.
  
  Thanks [EMAIL PROTECTED]
  Obtained from: [EMAIL PROTECTED]
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.13.2.4  +5 -3  
jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.13.2.3
  retrieving revision 1.13.2.4
  diff -u -r1.13.2.3 -r1.13.2.4
  --- PageContextImpl.java  2000/11/21 00:18:25 1.13.2.3
  +++ PageContextImpl.java  2001/09/01 00:40:03 1.13.2.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v 
1.13.2.3 2000/11/21 00:18:25 pierred Exp $
  - * $Revision: 1.13.2.3 $
  - * $Date: 2000/11/21 00:18:25 $
  + * $Header: 
/home/cvs/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v 
1.13.2.4 2001/09/01 00:40:03 costin Exp $
  + * $Revision: 1.13.2.4 $
  + * $Date: 2001/09/01 00:40:03 $
*
* 
*
  @@ -418,6 +418,8 @@
   throws ServletException, IOException
   {
   String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  + if( out!=null )
  + out.clearBuffer();
   context.getRequestDispatcher(path).forward(request, response);
   }
   
  
  
  



[FAQ] jGuru FAQ Update

2001-08-31 Thread Alex Chaffee

jGuru maintains FAQs and Forums on Servlets, JSP, and Tomcat (as well as
many other Java topics).  Here is an automated update on recent postings to
Tomcat-related FAQs.  Please direct flames and feedback to [EMAIL PROTECTED] .

 - Alex


SPONSORED BY developerWorks

need it? get it. tools, code and tutorials for open-standards based development.

Stay informed with dW's weekly email newsletter
http://www.jguru.com/misc/register_devworks.jsp?src=notify
-

Hi.  You asked to be notified weekly when certain jGuru.com items get new entries.

You can shut email notification off at the FAQ home
page(s) or:

  http://www.jguru.com/guru/notifyprefs.jsp


++ JavaServer Pages (JSP) FAQ: http://www.jguru.com/faq/JSP

I need to trap all kinds 500 error on my jsp page. I have tried the <%@ page 
errorPage="myerror.jsp"> but it only works on selected errors. How can I trap all 
errors, including syntax errors?
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=484004

Does anyone know how I could display an rtf string from JSP? I have resumes stored in 
a database and want to display them in a browser.
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=484003

Does anyone know how I could display an rtf string from JSP? I have resumes stored in 
a database and want to display them in a browser.
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=484002

How can I create complex, pretty reports which can be printed at the client from JSP?
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=484001

I know I can get JP tag attributes with setXXX() method but I want to know if  it is 
possible to modify attribute values within a tag handler.

For example:
I want to do iterator tag that iterates  over a list and at each iteation it can 
assign the current iterated value to one of its attributes and cause the JSP page to 
display different values at each iteration.
Is there any way to do this?
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=484000

Is it possible to view which web server or servlet engine is used: IIS, iPlanet etc. 
on a JSP page? Just like System.getProperty(os.name) for the operating system?
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=483999

How do I stop a JSP based download adding a newline to the first character of a file?
I am using JSP to set a Content-Disposition in order to keep IE from automatically 
opening Excel/Word/Acrobat/etc when it sees a file type it recognizes.  However, when 
I use ServletOutputStream to do this, for some reason I end up with a newline (ASCII 
hex 0A) character at the beginning of my file (I discovered this with a hex editor). 
This causes Word and Excel to blow up when I try to open the files because they can't 
cope with the extra character. (I am using the ATG Dynamo Application Server and am 
hoping this is not an artifact of the implementation.)

This is what my JSP looks like:

<%
// fname is the file name
File f = new File(fname);
InputStream in = new FileInputStream(f);
ServletOutputStream outs = response.getOutputStream();

int bufferSize = 4096;
byte[] ioBuffer = new byte[bufferSize];
byte[] lastBuffer; // last buffer
long counter = 0; // how many bytes we have gotten through
long fileSize = f.length();

response.setHeader("Content-Disposition", "attachment;filename=" + shortname);
response.setContentType("application/download");

// in a big file, use big buffer chunks
while (fileSize > (counter + bufferSize))
{
in.read(ioBuffer);
outs.write(ioBuffer);
   counter += bufferSize;
}

// add final chunk if the fileSize does not happen to be divisible by the bufferSize
if (fileSize > counter)
{
lastBuffer = new byte[ (int) (fileSize - counter) ];
in.read(lastBuffer);
outs.write(lastBuffer);
}

outs.flush();
outs.close();
in.close();
%>

I also tried to do this:

String headers = "Content-Disposition:attachment;filename=" + shortname + "\r\n" +
 "Content-Type: application/download\r\n\r\n";

outs.write(headers.getBytes());

in place of the setHeader() and setContentType() but I end up just opening a webpage 
with that string followed by the bytes from the file I want downloaded.
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=483996

++ Servlets FAQ: http://www.jguru.com/faq/Servlets

Are there any restrictions placed on applets loaded from HTML pages generated from 
servlets / JSP pages?
http://www.jguru.com/misc/faqtrampoline.jsp?src=notify&EID=485955





Re: Bug/Fix for HttpUtils.parseQueryString

2001-08-31 Thread Robert Lucier

My apologies. That was against the
jarkarta-servletapi-3.2.3 source. The file is
javax.servlet.http.HttpUtils.java.


--- Pier Fumagalli <[EMAIL PROTECTED]> wrote:
> "Robert Lucier" <[EMAIL PROTECTED]> wrote:
> 
> > Attatched is a fix for
> > HttpUtils.parseQueryString(String s) which allows
> a
> > key-only key value pair like "b" in "a=1&b&c=2".
> This
> > is necessary to work with some clients, and should
> not
> > break anything else. It interprets the above as
> b="",
> > instead of throwing an IllegalArgumentException
> like
> > the original.
> 
> It would be cool to know against what file/version
> it has been made...
> 
> Pier
> 


__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com



Re: Bug/Fix for HttpUtils.parseQueryString

2001-08-31 Thread Pier Fumagalli

"Robert Lucier" <[EMAIL PROTECTED]> wrote:

> Attatched is a fix for
> HttpUtils.parseQueryString(String s) which allows a
> key-only key value pair like "b" in "a=1&b&c=2". This
> is necessary to work with some clients, and should not
> break anything else. It interprets the above as b="",
> instead of throwing an IllegalArgumentException like
> the original.

It would be cool to know against what file/version it has been made...

Pier




Bug/Fix for HttpUtils.parseQueryString

2001-08-31 Thread Robert Lucier

Attatched is a fix for
HttpUtils.parseQueryString(String s) which allows a
key-only key value pair like "b" in "a=1&b&c=2". This
is necessary to work with some clients, and should not
break anything else. It interprets the above as b="",
instead of throwing an IllegalArgumentException like
the original.



__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
 HttpUtils.no_equal_sign_fix.diff


Re: cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docsssl-howto.xml

2001-08-31 Thread Christopher Cain


Justin Erenkrantz wrote:
> On Fri, Aug 31, 2001 at 02:48:56PM -0600, Christopher Cain wrote:
> 
>>Oh well ... as an unrepentant terminal geek, I'm glad I took the time to
>>learn it on the command line. Like most Linux commands, it has a pretty
>>steep learning curve, but once you're familiar with it it's really quite
>>powerful =)
>>
> 
> Hey, submit patches for the dev.apache.org site to add what you
> learned.  I think the instructions there are pretty lacking.
> FreeBSD has some nice introductory docs for committers.  Steal
> from them.  =-)  
> 
> May be best to post to [EMAIL PROTECTED] with any docs about
> this rather than tomcat-dev.  -- justin
> 

That's a good idea =)

(Going off-list now, will post a follow-up here once I have something in 
place, probably late next week.)

- Christopher

/**
  * Pleurez, pleurez, mes yeux, et fondez vous en eau!
  * La moitié de ma vie a mis l'autre au tombeau.
  *---Cornelle
  */




Re: cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docsssl-howto.xml

2001-08-31 Thread Justin Erenkrantz

On Fri, Aug 31, 2001 at 02:48:56PM -0600, Christopher Cain wrote:
> Oh well ... as an unrepentant terminal geek, I'm glad I took the time to
> learn it on the command line. Like most Linux commands, it has a pretty
> steep learning curve, but once you're familiar with it it's really quite
> powerful =)

Hey, submit patches for the dev.apache.org site to add what you
learned.  I think the instructions there are pretty lacking.
FreeBSD has some nice introductory docs for committers.  Steal
from them.  =-)  

May be best to post to [EMAIL PROTECTED] with any docs about
this rather than tomcat-dev.  -- justin




Re: cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docsssl-howto.xml

2001-08-31 Thread Christopher Cain


Pier Fumagalli wrote:
> 
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> 
> > ccain   01/08/31 13:15:12
> >
> > Modified:webapps/tomcat-docs ssl-howto.xml
> > Log:
> > A few minor typo and semantic changes.
> >
> > Also included a short blurb about passing JSSE to Tomcat in the CLASSPATH
> > rather than making it an installed extension, as suggested by
> > Wolfgang Hoschek <[EMAIL PROTECTED]>.
> 
> First commit :) Whoh! :)
> 
> Pier

;-)

First commit would have actually been eariler this week if I had just
learned command-line cvs from the beginning, instead of trying
unsuccessfully to make WinCVS work for me. Larry was a _great_ help in
getting me 95% of the way there, but in the end I just hit a brick wall
with the functionality, and it didn't do what I needed it to :(

Oh well ... as an unrepentant terminal geek, I'm glad I took the time to
learn it on the command line. Like most Linux commands, it has a pretty
steep learning curve, but once you're familiar with it it's really quite
powerful =)

- Christopher

/**
 * Pleurez, pleurez, mes yeux, et fondez vous en eau!
 * La moitié de ma vie a mis l'autre au tombeau.
 *---Cornelle
 */



Re: cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docsssl-howto.xml

2001-08-31 Thread Remy Maucherat

> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > ccain   01/08/31 13:15:12
> >
> > Modified:webapps/tomcat-docs ssl-howto.xml
> > Log:
> > A few minor typo and semantic changes.
> >
> > Also included a short blurb about passing JSSE to Tomcat in the
CLASSPATH
> > rather than making it an installed extension, as suggested by
> > Wolfgang Hoschek <[EMAIL PROTECTED]>.
>
> First commit :) Whoh! :)

Yes indeed !

Remy




Re: Build system for mod_webapp and Apache 2.0

2001-08-31 Thread Ryan Bloom

> > > LOCAL_HEADER([Configuring APR])
> > > LOCAL_FILTEREXEC(
> > > -  [./configure --enable-static --disable-shared --disable-threads],
> > > +  [./configure --enable-static --disable-threads],
> > >  ["APR configure"])
> > > if ${TEST} "${ret}" -ne "0"
> > > then
> >
> > Hmm... I'd like to rely on the APR code coming with Apache 2.0 instead of
> > building our local copy with Apache 2.0... (I'll see what I can figure
> > out, hoping that 2.0 works on my OS/X box :)
>
> Oh, if that's what you want to do, I can make that happen.  Give me five
> minutes, and you'll have a patch.  :-)

Sorry, I got called into a meeting, so this took a little bit longer than I wanted it
to.  Here is a patch that stops us from building APR, and we just use the one
from Apache 2.0.

Index: Makefile.in
===
RCS file: /home/cvspublic/jakarta-tomcat-connectors/webapp/Makefile.in,v
retrieving revision 1.16
diff -u -d -b -w -u -r1.16 Makefile.in
--- Makefile.in 2001/08/31 10:26:24 1.16
+++ Makefile.in 2001/08/31 20:36:29
@@ -70,11 +70,11 @@
config.log \
config.status
 
-all: apr-all local-all
+all: @APR_BUILD@ local-all
 
 install: local-install
 
-clean: apr-clean local-clean
+clean: @APR_CLEAN@ local-clean
 
 distclean: clean
@$(ECHO) ""
Index: configure.in
===
RCS file: /home/cvspublic/jakarta-tomcat-connectors/webapp/configure.in,v
retrieving revision 1.24
diff -u -d -b -w -u -r1.24 configure.in
--- configure.in2001/08/31 10:26:24 1.24
+++ configure.in2001/08/31 20:36:29
@@ -210,15 +210,21 @@
 APA=`${GREP} STANDARD20 ${APXS}`
 if  ${TEST} -z "$APA" ; then
   TARGET="${SRCDIR}/apache-1.3"
+  APR_BUILD="apr-all"
+  APR_CLEAN="apr-clean"
   makefile="apache-1.3/Makefile"
 else
   TARGET="${SRCDIR}/apache-2.0"
+  APR_BUILD=""
+  APR_CLEAN=""
   makefile="apache-2.0/Makefile"
 fi
 AC_MSG_RESULT([setting target module to... ${TARGET}])
   ]
 )
 AC_SUBST(TARGET)
+AC_SUBST(APR_BUILD)
+AC_SUBST(APR_CLEAN)
 
 dnl --
 dnl Process the --with-apr=... command line argument
@@ -226,10 +232,16 @@
 AC_MSG_CHECKING([APR directory])
 AC_ARG_WITH(apr,
   [  --with-apr=DIR  where the APR sources can be found.],
-  APRDIR="${withval}",
-  APRDIR="${SRCDIR}/apr"
+  APRDIR="${withval}"
 )
 
+if ${TEST} -z "${APA}" -a -z "${APRDIR}" ; then
+  APRDIR="{SRCDIR}/apr"
+else
+  APRDIR="${APXS_PREFIX}"
+fi
+
+if ${TEST} -z "${APA}" ; then
 if ${TEST} ! -d "${APRDIR}" ; then
   AC_MSG_ERROR([Cannot find APR sources directory \"${APRDIR}\"])
 fi
@@ -267,6 +279,9 @@
   AC_MSG_ERROR([APR configure script terminated with error code ${ret}])
 fi
 cd ${curdir}
+else
+  AC_MSG_RESULT(Using APR from Apache build)
+fi
 
 dnl --
 dnl Retrieving APR default values
@@ -275,19 +290,29 @@
 
 if ${TEST} ! -f ${APRDIR}/APRVARS
 then
+  if ${TEST} "${APA}" ; then
+LIBDIR="/lib"
+  else
   AC_MSG_RESULT([error])
   AC_MSG_ERROR([Cannot find APR defaults in ${APRDIR}/APRVARS])
 fi
+else
+  LIBDIR=""
+fi
 
 if ${TEST} ! -x ${APRDIR}/libtool
 then
+  if ${TEST} "${APA}" ; then
+LIBTOOL="${APXS_PREFIX}/build/libtool"
+  else
   AC_MSG_RESULT([error])
   AC_MSG_ERROR([Cannot find APR libtool binary])
+  fi
 else
   LIBTOOL="${APRDIR}/libtool"
 fi
 
-eval `cat ${APRDIR}/APRVARS`
+eval `cat ${APRDIR}${LIBDIR}/APRVARS`
 AC_SUBST(CC)
 AC_SUBST(CPP)
 AC_SUBST(SHELL)

__
Ryan Bloom  [EMAIL PROTECTED]
Covalent Technologies   [EMAIL PROTECTED]
--



Re: cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docsssl-howto.xml

2001-08-31 Thread Pier Fumagalli

"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> ccain   01/08/31 13:15:12
> 
> Modified:webapps/tomcat-docs ssl-howto.xml
> Log:
> A few minor typo and semantic changes.
> 
> Also included a short blurb about passing JSSE to Tomcat in the CLASSPATH
> rather than making it an installed extension, as suggested by
> Wolfgang Hoschek <[EMAIL PROTECTED]>.

First commit :) Whoh! :)

Pier




cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs ssl-howto.xml

2001-08-31 Thread ccain

ccain   01/08/31 13:15:12

  Modified:webapps/tomcat-docs ssl-howto.xml
  Log:
  A few minor typo and semantic changes.
  
  Also included a short blurb about passing JSSE to Tomcat in the CLASSPATH
  rather than making it an installed extension, as suggested by
  Wolfgang Hoschek <[EMAIL PROTECTED]>.
  
  Revision  ChangesPath
  1.5   +24 -14jakarta-tomcat-4.0/webapps/tomcat-docs/ssl-howto.xml
  
  Index: ssl-howto.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/ssl-howto.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ssl-howto.xml 2001/08/27 20:39:55 1.4
  +++ ssl-howto.xml 2001/08/31 20:15:12 1.5
  @@ -7,7 +7,7 @@
   &project;
   
   
  -Christopher Cain
  +Christopher Cain
   SSL Configuration HOW-TO
   
   
  @@ -30,9 +30,10 @@
   these simple steps.  For more information, read the rest of this HOW-TO.
   
   Download JSSE 1.0.2 (or later) from
  -http://java.sun.com/products/jsse/";>http://java.sun.com/products/jsse/
  -and make it an installed extension by copying the included JAR
  -files into $JAVA_HOME/jre/lib/ext.
  +   http://java.sun.com/products/jsse/";>http://java.sun.com/products/jsse/
  +   and either make it an installed extension on the system, or else add it
  +   to the classpath being passed to Tomcat in the Catalina startup script.
  +
   Create a certificate keystore by executing the following command:
   
   keytool -genkey -alias tomcat -keyalg RSA
  @@ -100,7 +101,7 @@
   before receiving any sensitive information.  While a broader explanation of
   Certificates is beyond the scope of this document, think of a Certificate
   as a "digital driver's license" for an Internet address.  It states what
  -company the address is associated with, along with some basic contact
  +company the site is associated with, along with some basic contact
   information about the site owner or administrator.
   
   This "driver's license" is cryptographically signed by its owner, and is
  @@ -158,7 +159,7 @@
   handshake, where the client browser accepts the server certificate, must occur
   before the HTTP request is accessed.  As a result, the request information
   containing the virtual host name cannot be determined prior to authentication,
  -ant it is therefore not possible to assign multiple certificates to a single
  +and it is therefore not possible to assign multiple certificates to a single
   IP address.  If all virtual hosts on a single IP address need to authenticate
   against the same certificate, the addition of multiple virtual hosts should not
   interfere with normal SSL operations on the server.  Be aware, however, that
  @@ -181,16 +182,25 @@
   package.  If you are running JDK 1.4 (currently in beta), these classes have
   been integrated directly into the JDK, so you can skip this entire step.
   
  -After expanding the package, copy all three JAR files
  -(jcert.jar, jnet.jar, and jsse.jar)
  -into your $JAVA_HOME/jre/lib/ext directory.  This effectively
  -makes them "installed extensions," and eliminates the need to put them into
  -the CLASSPATH.
  +After expanding the package, there are two ways to make it available to Tomcat.
  +The easiest approach is to simply make it an installed extension by 
  +copying all three JAR files (jcert.jar, jnet.jar, and
  +jsse.jar) into your $JAVA_HOME/jre/lib/ext directory.
  +In effect, this eliminates the need to have them in any CLASSPATH.
  +
  +If making the JSSE libraries an installed extension is either not possible or
  +not desirable in your particular environment, the alternative approach is to 
  +add the JAR files to Tomcat's startup CLASSPATH. Because Tomcat
  +ignores the system CLASSPATH, this approach involves modifying the 
  +Catalina command script for your particular environment (catalina.sh
  +under Unix, or catalina.bat in Windows). Add the JSSE libraries to
  +the classpath being passed to the java command.
   
   WARNING - Do not copy any of these JAR
  -files into any of the internal Tomcat directories, or manually include them
  -on the CLASSPATH environment variable in your startup scripts.
  -Doing this will cause Tomcat to fail at startup time.
  +files into any of the internal Tomcat directories. Also, do not make them both an
  +installed extension and include them in the startup script's 
  +CLASSPATH. Either of these two scenerios will cause Tomcat to fail
  +on startup.
   
   
   
  
  
  



Re: Bug in FormAuthenticator?

2001-08-31 Thread Craig R. McClanahan

While Tomcat should definitely react better than it does, it's worth
pointing out that you should ***not*** be accessing the login page
yourself.  Let Tomcat use it as needed, the first time a particular user
tries to access a resource protected by a security constraint.

Think about how BASIC authentication works - you never actually link to
the login pop-up window, right?  The server just displays it as necessary,
then completes the originally requested request.  The design of form based
authentication attempts to mimic that user experience.

Craig


On Wed, 29 Aug 2001, Bragg, Casey wrote:

> Date: Wed, 29 Aug 2001 22:37:16 -0500
> From: "Bragg, Casey" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: Bug in FormAuthenticator?
>
> I think the following action causes a bug :
>
> Tomcat 4.0b7 (not specific to this release)
> JDBCRealm (not specific to this realm)
> FormAuthenticator
>
> 1)Go to the URL of the specified login page (go directly to it).
> 2)Login correctly.
> 3)You will be sent to /null or /context/null.  (unless my configuration is
> screwed up)
>
> I think the problem is in the savedRequestURL method.  I don't know if this
> solution is mentioned in the spec, but it seems pretty important.
>
> This is how I think the code should be :
>
> private String savedRequestURL(Session session) {
>
> ...snip
> if (saved == null) {
> return (null);
> } else {
> // where config.getDefaultPage returns a page URL to
> // go to if the Login page was requested directly
> // (no request was saved).  I suppose this would be set
> // the same way the LoginPage URL was specified
> return config.getDefaultPage();
> }
> ...snip
> }
>




RE: Extending Server.xml configurability (foradditionalclasspaths)

2001-08-31 Thread Craig R. McClanahan



On Wed, 29 Aug 2001, Rob S. wrote:

> Date: Wed, 29 Aug 2001 16:39:38 -0700
> From: Rob S. <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: RE: Extending Server.xml configurability
> (foradditionalclasspaths)
>
> > No worries; in fact, I really don't understand the mechanism.
> > However, if it
> > helps me, I'd like to understand it. Since then, I've read about the
> > ClassLoader, SecurityManager, and System classes.
>
> I'm still getting used to be back in Vancouver, so I dunno if Craig has
> mentioned, or possible checked in, his Catalina classloader document, but
> kudos to that thing, at least the old one.  It was really good.  I started
> working on a class-not-found doc that approached the 'problem' from the
> other angle, as in, "I've go
>

It's not converted into the new-style doc format yet, but my document that
summarizes how Tomcat 4 class loaders are organized is in the
"catalina/docs/dev" directory of the source distribution, and is also
visible by following the documentation links at 
when you start an unmodified Tomcat 4 installation.

Craig




Re: Extending Server.xml configurability (for additionalclasspaths)

2001-08-31 Thread Craig R. McClanahan

Two quick comments embedded.

On Wed, 29 Aug 2001, Rick Mann wrote:

> Date: Wed, 29 Aug 2001 15:40:52 -0700
> From: Rick Mann <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: Extending Server.xml configurability (for
> additionalclasspaths)
>
> on 8/29/01 3:23 PM, Rob S. at [EMAIL PROTECTED] wrote:
>
> > When I wrote the email, I wasn't implying that whatsoever, but I can see
> > quite clearly now how it could be taken.  Apologies for that implication...
>
> No worries; in fact, I really don't understand the mechanism. However, if it
> helps me, I'd like to understand it. Since then, I've read about the
> ClassLoader, SecurityManager, and System classes. I could experiment, but in
> what I've read, I not sure I can install a new ClassLoader/SecurityManager
> which will get used by all classes in my web app next time a class needs to
> be loaded. Is there a way to specify the ClassLoader used by a context?
>
> > Ok, let me get this straight now.  You're saying, "i want to point a web app
> > to a location to load jars and classes from."  That already exists.  You put
> > the jars in the WEB-INF/classes and lib directory.
>
> Understood.
>
> > Then the next thing is, "i want them to be visible to more than one web
> > app."  That already exists too.  You put them in $CATALINE_HOME/common/lib
> > and classes.
>
> Didn't realize that one, closer to what I want. In the meantime, that will
> probably solve my problem, however, it's not a general solution (see below).
>

This works, but it also gives access to these classes to Catalina's
internal class loader.  This is important for something like servlet.jar
(which has to be the same both inside and outside the container), but not
generally required for applications.

The canonical place to put shared things that are just for application use
is in a JAR file under $CATALNIA_HOME/lib, or in unpacked classes under
$CATALINA_HOME/classes.

> > What do you want that Tomcat isn't already giving you? =)
>
> I want to specify a subset of all installed contexts that have access. I
> don't want all installed contexts to have access, just the ones I specify.
>

That would definitely require adding additional class loaders to the
hierarchy provided by Catalina.

> Now, to avoid changing the spec, which I understand to be the Servlet 2.2
> spec, which also understand to specify the structure of the web.xml file, I
> propose adding the functionality to the Server.xml file, which I believe to
> be defined by the core developers. If this is not the case, well, it makes
> my request more difficult.
>

Well, I've got *one* piece of good news for this discussion -- it's not a
spec issue at all :-).

The only thing the Servlet Specification talks about is /WEB-INF/classes
and /WEB-INF/lib.  Any additional capability to support sharing classes
across web applications is (by definition) container specific and is not,
in fact, required to be present at all, in any form.  (In other words,
portable applications cannot rely on *anything* outside the web app.)

Since server.xml is a Tomcat thing and not a spec thing, it's definitely
relevant here.

> TIA,
>
> 
> Roderick Mann   rmann @ latencyzero.com.sansspam
>

Craig




Re: Extending Server.xml configurability (for additional classpaths)

2001-08-31 Thread Craig R. McClanahan

Wouldn't option (3) -- modify the startup shell scripts yourself to
include whatever directories you want -- be easier than either (1) or (2)?

Of course, you're going to be on your own for resolving class loading
difficulties, but that's true under all of these scenarios.

Craig


On Wed, 29 Aug 2001, Rick Mann wrote:

> Date: Wed, 29 Aug 2001 13:41:41 -0700
> From: Rick Mann <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED], Christopher Cain <[EMAIL PROTECTED]>
> Subject: Re: Extending Server.xml configurability (for additional
> classpaths)
>
> on 8/29/01 1:15 PM, Christopher Cain at [EMAIL PROTECTED] wrote:
>
> > I'll throw an idea out here, although it may well get shot down for
> > either spec non-compliance, possible security concerns, or just general
> > lack of sex appeal ;-)
>
> I think I'd complain mostly on the grounds of lack of sex appeal. ;-)
>
> Seriously, though, this amounts to tricking Tomcat, I think, and that
> solution does not seem terribly elegant.
>
> BTW, I missed the email that said Tomcat ignores CLASSPATH, but I've
> inferred now that it does (which explains why I couldn't get that approach
> to work).
>
> So, I'm left with two alternatives that should satisfy my sense of
> aesthetics, but one of which is easier for me (the app developer) to use.
>
> 1) Extend Server.xml to tell Tomcat what additional directories to put in
> the search path.
>
> 2) Add those search paths myself, in my webapp's code. Keep in mind that, as
> Rob S. speculated, I know very little about the ClassLoader mechanism.
>
> Solution (1) is my preferred choice, because it localizes the burden of
> expanding the search path to Tomcat, and provides the most security (the
> owner of the Tomcat installation has control of what the webapps have access
> to).
>
> Solution (2) works, assuming it can be done, and assuming I can get educated
> on how to do it. However, it adds work to each and every webapp developer,
> in that they have to write code, rather than adding a line to a config file.
> It also means there will be countless ways of specifying (hard-coding,
> private properties, etc), which complicates people working together.
>
> I'm going to look up the ClassLoader now, and see if I can learn anything.
>
> 
> Roderick Mann   rmann @ latencyzero.com.sansspam
>
>
>




Re: Catalina 4.0-b7 - StandardWrapper.load() - bug?

2001-08-31 Thread Craig R. McClanahan

Well, the "embedded" option in the startup isn't really intended for
production use anyway, since it only fires off the demonstration main()
method that runs for a couple of minutes and shuts off.

I've seen two basic approaches people take to embedding Tomcat:

* If they like configuration from conf/server.xml, they will
  build wrappers around calling the main() method of the Bootstrap
  class, which will do all the usual initialization, but without
  requiring you to run the startup shell script.

* If they like configuration based on some other representation
  of the Tomcat components to create, they will use the Embedded
  class.  For example, the J2EE Reference Implementation (version 1.3)
  does this, because it has its own internal description of what
  virtual hosts and web apps need to be created.

Craig


On Thu, 30 Aug 2001, Nick Betteridge wrote:

> Date: Thu, 30 Aug 2001 16:51:37 +0100
> From: Nick Betteridge <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: Catalina 4.0-b7 - StandardWrapper.load() - bug?
>
> I suspect that I may be opening a can of worms on this one as I see that
> the 'embedded' option in the 'catalina.sh' doesn't have a '-security'
> option.
>
> I guess that the only sensible way to proceed is to try and mimic the
> embedded functionality with a mapper type approach as used with the
> standalone implementation.
>
> If nobody hears from me within a week, send in the dogs.
>
> Nick
>
>
>
> Nick Betteridge wrote:
> >
> > Hi Craig
> >
> > Thanks for your reply and apologies for the late reply. The goalposts
> > have changed slightly but the problem appears to be the same.
> >
> > I've set up the MBean server environment to create the two classloaders
> > (a la Bootstrap) and when I fire up the server with a Security Manager,
> > I find that the (catalina) loader can find the javax.servlet.Servlet
> > class but the Container Base cannot.
> >
> > servlet.jar is not in any CLASSPATH (save the classloaders).
> >
> > For the simple example ..
> >
> >
> > System.out.println(CatalinaClassLoaders.getCatalinaClassLoader());
> > System.out.println(CatalinaClassLoaders.getSharedClassLoader());
> >
> > try {
> > 
>System.out.println(Thread.currentThread().getContextClassLoader().loadClass("javax.servlet.Servlet"));
> > } catch (Exception ex) {
> > ex.printStackTrace();
> > }
> >
> > Embedded embedded = new Embedded();
> > Engine engine = embedded.createEngine();
> >
> > . I get the following output showing the classloaders (including
> > the servlet.jar), the 'javax.servlet.Servlet' interface and then the
> > stacktrace with NoClassDefFoundError: javax/servlet/Servlet Exception
> > ...
> >
> > StandardClassLoader
> >   available:
> >   delegate: false
> >   repositories:
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/jakarta-regex
> > p-1.2.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/crimson.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/catalina.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/warp.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/jaxp.jar
> >   required:
> > --> Parent Classloader:
> > StandardClassLoader
> >   available:
> >   delegate: false
> >   repositories:
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/servlet.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/naming.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/resources.jar
> >   required:
> > --> Parent Classloader:
> > sun.misc.Launcher$AppClassLoader@2c3c08
> >
> > StandardClassLoader
> >   available:
> >   delegate: false
> >   repositories:
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/lib/namingfactory.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/lib/jasper-runtime.jar
> >   required:
> > --> Parent Classloader:
> > StandardClassLoader
> >   available:
> >   delegate: false
> >   repositories:
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/servlet.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/naming.jar
> >
> > file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/resources.jar
> >   required:
> > --> Parent Classloader:
> > sun.misc.Launcher$AppClassLoader@2c3c08
> >
> > interface javax.servlet.Servlet
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > javax/servlet/Servlet
> > Exception
> > at
> > org.apache.catalina.core.ContainerBase.(ContainerBase.java:254)
> > at
> > org.apache.catalina.core.StandardEngine.(StandardEngine.java:10
> > 4)
> > at
> > org.apache.catalina.startup.Embedded.createEngine(Embedded.java:577)
> > at
> > com.syntactics.server.management.catalina.Bootstrap.(Bootstrap.
> > java:191)
> > at
> > com.syntactics.server.management.catalina.Bo

[PATCH] 3.2.3 and 3.3 fix for JspWriter buffer not being cleared on JSP forward

2001-08-31 Thread Shawn McMurdo

Attached are patches against the current 3.2 branch and the 3.3 head
to fix a problem when JSPs forward requests.
The JspWriter buffer was not being cleared before the forward.
The modified file is:
src/share/org/apache/jasper/runtime/PageContextImpl.java.
Shawn


--
Shawn McMurdo  mailto:[EMAIL PROTECTED]
Lutris Technologieshttp://www.lutris.com
Enhydra.Orghttp://www.enhydra.org



Index: PageContextImpl.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
retrieving revision 1.13.2.3
diff -u -r1.13.2.3 PageContextImpl.java
--- PageContextImpl.java2000/11/21 00:18:25 1.13.2.3
+++ PageContextImpl.java2001/08/31 18:59:43
@@ -418,6 +418,9 @@
 throws ServletException, IOException
 {
 String path = getAbsolutePathRelativeToContext(relativeUrlPath);
+   if (out != null) {
+   out.clearBuffer();
+   }
 context.getRequestDispatcher(path).forward(request, response);
 }
 


Index: PageContextImpl.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
retrieving revision 1.20
diff -u -r1.20 PageContextImpl.java
--- PageContextImpl.java2001/03/23 02:21:20 1.20
+++ PageContextImpl.java2001/08/31 19:00:39
@@ -415,6 +415,9 @@
 throws ServletException, IOException
 {
 String path = getAbsolutePathRelativeToContext(relativeUrlPath);
+   if (out != null) {
+   out.clearBuffer();
+   }
 context.getRequestDispatcher(path).forward(request, response);
 }
 



tracking "concurrent usage"

2001-08-31 Thread Michael Stacey

I know; I know; there's no limit to what sales managers come up with!  8-)

We have a web application that allows access based upon logins/pwds or
ip-based site licenses.  Our sales geniuses want to take some arbitrary time
limit (like 10 minutes) and say that usage from multiple ips within that
time frame from the same account is "concurrent" and limit the number of 
"concurrent" users.

All we can think of is having to slow response to the whole user base by
inspecting *every* service requests and persisting the session/licence
info somehow to check for each service request.

Does anyone have a more elegant/saner solution idea?




-- Michael 





Re: Accessing protected files trough JSP how?

2001-08-31 Thread Ed Milic

Hi,

All you have to do is drop the JSP files you want protected into
the WEB-INF directory.  These cannot be served up to the user but
you can link to/include them in your other JSP pages.


Hope that helps,

Ed Milic

>From: "Roland" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>CC: <[EMAIL PROTECTED]>
>Subject: Accessing protected files trough JSP how?
>Date: Fri, 31 Aug 2001 15:21:42 -0300
>
>Hello,
>we are creating a JSP web-page for several users with login.
>Now my question is, each user has specific files, which other users
>shouldn't be allowed to read. Now one alternative would be to create a
>directory for each user and only assign the specific user the rights to 
>read
>that directory using the web.xml file. I think that is a lot of overhead,
>because if you have 500 users you will have to create 500 dirs, and put 500
>roles in your web-xml file.
>
>But there is another approach idea which I think is simpler to implement.
>Instead of creating one dir for each user, how about storing all files on
>the same dir. The dir shouldnt be accessible for any of the users, and the
>files should be accessed through a JSP page. The JSP page would decide 
>which
>file to show to which user depending on his userid.
>The problem is, how can the JSP page access a file that is not accessible 
>to
>the user?
>
>Any ideas here?
>
>
>Thanks Roland
>


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




Re: Build system for mod_webapp and Apache 2.0

2001-08-31 Thread Pier Fumagalli

"Ryan Bloom" <[EMAIL PROTECTED]> wrote:
> 
>> Hmm... I'd like to rely on the APR code coming with Apache 2.0 instead of
>> building our local copy with Apache 2.0... (I'll see what I can figure out,
>> hoping that 2.0 works on my OS/X box :)
> 
> Oh, if that's what you want to do, I can make that happen.  Give me five
> minutes, and you'll have a patch.  :-)

Yeah... I mean, it's pointless to build APR if Apache 2.0 has it already :)
Also, we avoid versioning conflicts (since right now APR is linked-in
statically, at least in 1.3)...

Pier




Re: Extending Server.xml configurability (foradditionalclasspaths)

2001-08-31 Thread Christopher Cain


Rick Mann wrote:
> 
> First off, I apologize for being rude. It wasn't my intent. But I was trying
> to quash what I interpreted to be a deliberate attempt to say "just do
> this". The point I'm trying to make is that "this" (the solutions proposed
> so far) don't really solve my problem.

No worries :)

> So, please accept my apologies for getting frustrated and short. What I
> originally asked for was some guidance into the Catalina sources so that I
> could implement this myself. I'd love it if the feature were incorporated
> into the Tomcat sources permanently, but that was not a requirement (yet,
> anyway ;-) )
> 
> on 8/31/01 10:02 AM, Christopher Cain at [EMAIL PROTECTED] wrote:
> 
> > Look, if you want shared classes for multiple webapps, but not all
> > webapps, then:
> >
> > 1) Create a common directory outside of TC
> > 2) Put the jars there
> > 3) Create symlinks to the jars in the relevant WEB-INF/lib subdiretories
>
> The problem with this solution is that it implements class sharing in the
> file system, which is neither clean nor necessarily portable. What if I'm
> running catalina on a device that doesn't support symlinks?

AFAIK, there is no "standard" system that TC runs on which does not
support symlinks. For Windows there's always Cygwin, which many people
(myself included :) prefer to run Tomcat in anyway, should you find
yourself stuck in Windoze. I suppose that some of the "embedded" devices
might not do symlinks, since I'm not too familiar with them. I would
consider the above approach to be fairly portable, but that's just me.

As far as class sharing in the file system, the only way in which I can
see it being "unclean" is in the case of shared memory, static
resources, etc. (and in that case, you'll need to separate things out
anyway). Symlinks are _very_ common in the Unix world, and even M$ has
decided to use them in all of their new filesystems (in fact, I saw a
press release last year in which they seemed to imply that they recently
_invented_ them ... LOL!). They are quite a handy little solution in
most cases, and I use them frequently for many things Tomcat.

But of course, this is just one man's opinion, based on my experience
with things similar to what you are facing. If you don't feel that
symlinks are a clean answer, then I'm probably not going to convince you
at this point, so I'll shut up it now :)

> > Paul, like a few others, was obviously just trying to understand what
> 
> Sorry, Paul. I took the wording of your message to be "why not just copy the
> classes", which has been suggested several times and is not what I want or
> need. I didn't realize you were actually trying to understand what it is I
> want. That is, however, what I want. Thanks.
> 
> 
> Roderick Mann   rmann @ latencyzero.com.sansspam

- Christopher

/**
 * Pleurez, pleurez, mes yeux, et fondez vous en eau!
 * La moitié de ma vie a mis l'autre au tombeau.
 *---Cornelle
 */



Accessing protected files trough JSP how?

2001-08-31 Thread Roland

Hello,
we are creating a JSP web-page for several users with login.
Now my question is, each user has specific files, which other users
shouldn't be allowed to read. Now one alternative would be to create a
directory for each user and only assign the specific user the rights to read
that directory using the web.xml file. I think that is a lot of overhead,
because if you have 500 users you will have to create 500 dirs, and put 500
roles in your web-xml file.

But there is another approach idea which I think is simpler to implement.
Instead of creating one dir for each user, how about storing all files on
the same dir. The dir shouldnt be accessible for any of the users, and the
files should be accessed through a JSP page. The JSP page would decide which
file to show to which user depending on his userid.
The problem is, how can the JSP page access a file that is not accessible to
the user?

Any ideas here?


Thanks Roland




Re: cvs commit: jakarta-tomcat-connectors/webapp/apache-2.0Makefile.in

2001-08-31 Thread Pier Fumagalli

"Ryan Bloom" <[EMAIL PROTECTED]> wrote:

> On Friday 31 August 2001 10:32, Pier Fumagalli wrote:
>> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>>> jfclere 01/08/29 07:29:29
>>> 
>>> Modified:webapp   configure.in
>>> Added:   webapp/apache-2.0 Makefile.in
>>> Log:
>>> Copy/add configure logic for Apache-2.0 from mod_jk.
>>> 
>>> Revision  ChangesPath
>>> 1.23  +12 -3 jakarta-tomcat-connectors/webapp/configure.in
>> 
>> APXS is broken in Apache 2.0... We should rely on APRVARS...
> 
> I actually fixed APXS this last weekend, and I have used it many times
> now to build mod_webapp.   :-)

GREAT news :)

Pier






cvs commit: jakarta-tomcat-connectors/webapp/java WarpConfigurationHandler.java

2001-08-31 Thread pier

pier01/08/31 10:55:09

  Modified:webapp/java WarpConfigurationHandler.java
  Log:
  
Enhance Catalina startup/shutdown processing to support a new (optional)
environment variable (CATALINA_BASE), and corresponding system property
(catalina.base).  If not set, these values default to
corresponding values for CATALINA_HOME and catalina.home, respectively.
  
When you set CATALINA_BASE to point to a directory other than the one
pointed to by CATALINA_HOME, you are changing the *default* base from
which all references to files in the "conf", "logs", "webapps", and "work"
directories are resolved.  This allows you to share the static portion of
a Tomcat 4 installation (read-only) among multiple uses of that
installation on the same server.
  
TODO:  A pass through the docs to update them with this new information is
coming up shortly.
  
Submitted by:  Too numerous to count :-)
  
  
  Revision  ChangesPath
  1.14  +1 -1  
jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java
  
  Index: WarpConfigurationHandler.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConfigurationHandler.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WarpConfigurationHandler.java 2001/08/10 02:58:01 1.13
  +++ WarpConfigurationHandler.java 2001/08/31 17:55:09 1.14
  @@ -288,7 +288,7 @@
   Deployer deployer=(Deployer)host;
   File file=new File(host.getAppBase()+File.separator+applName);
   if (!file.isAbsolute()) {
  -file=new File(System.getProperty("catalina.home"),
  +file=new File(System.getProperty("catalina.base"),
 host.getAppBase()+File.separator+applName);
   }
   
  
  
  



cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnector.java

2001-08-31 Thread pier

pier01/08/31 10:50:34

  Modified:webapp/java WarpConnector.java
  Log:
  
Add navigation link properties so that the entire Catalina component
hierarchy can be navigated.  Previously, you could go "down" from a
Service to its associated "Connector" and "Container" children, but you
could not go up.
  
Note that the existence of Server and Service components is optional -
they are used when Catalina is configured from conf/server.xml, but are
not typically used in embedded environments.
  
  
  Revision  ChangesPath
  1.19  +25 -0 jakarta-tomcat-connectors/webapp/java/WarpConnector.java
  
  Index: WarpConnector.java
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnector.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- WarpConnector.java2001/07/25 01:29:59 1.18
  +++ WarpConnector.java2001/08/31 17:50:34 1.19
  @@ -73,6 +73,7 @@
   import org.apache.catalina.Logger;
   import org.apache.catalina.Request;
   import org.apache.catalina.Response;
  +import org.apache.catalina.Service;
   import org.apache.catalina.net.DefaultServerSocketFactory;
   import org.apache.catalina.net.ServerSocketFactory;
   import org.apache.catalina.util.LifecycleSupport;
  @@ -112,6 +113,8 @@
   private String scheme="warp";
   /** The secure flag of this Connector. */
   private boolean secure=false;
  +/** The Service we are associated with (if any). */
  +private Service service=null;
   /** Descriptive information of this Connector. */
   private String info=null;
   /** The address we need to bind to. */
  @@ -287,6 +290,28 @@
   
   if (Constants.DEBUG) logger.debug("Setting secure to "+secure);
   }
  +
  +/**
  + * Return the Service with which we are associated (if any).
  + */
  +public Service getService() {
  +
  +return (this.service);
  +
  +}
  +
  +
  +/**
  + * Set the Service with which we are associated (if any).
  + *
  + * @param service The service that owns this Engine
  + */
  +public void setService(Service service) {
  +
  +this.service = service;
  +
  +}
  +
   
   /**
* Return descriptive information about this Connector.
  
  
  



Re: Patch for mod_webapp Java

2001-08-31 Thread Pier Fumagalli

"Dave Oxley" <[EMAIL PROTECTED]> wrote:

> WarpConnector.java in jakarta-tomcat-connectors/webapp/java does not
> compile. I have fixed it and a patch is supplied. Can someone check it over
> and check it in.

There is an update from Craig on that, in the jakarta-tomcat-4.0 tree...
(It's the same one AFAIK)... Checking in...

Pier




Re: Extending Server.xml configurability (foradditionalclasspaths)

2001-08-31 Thread Rick Mann

First off, I apologize for being rude. It wasn't my intent. But I was trying
to quash what I interpreted to be a deliberate attempt to say "just do
this". The point I'm trying to make is that "this" (the solutions proposed
so far) don't really solve my problem.

So, please accept my apologies for getting frustrated and short. What I
originally asked for was some guidance into the Catalina sources so that I
could implement this myself. I'd love it if the feature were incorporated
into the Tomcat sources permanently, but that was not a requirement (yet,
anyway ;-) )

on 8/31/01 10:02 AM, Christopher Cain at [EMAIL PROTECTED] wrote:

> Look, if you want shared classes for multiple webapps, but not all
> webapps, then:
> 
> 1) Create a common directory outside of TC
> 2) Put the jars there
> 3) Create symlinks to the jars in the relevant WEB-INF/lib subdiretories

The problem with this solution is that it implements class sharing in the
file system, which is neither clean nor necessarily portable. What if I'm
running catalina on a device that doesn't support symlinks?

> Paul, like a few others, was obviously just trying to understand what

Sorry, Paul. I took the wording of your message to be "why not just copy the
classes", which has been suggested several times and is not what I want or
need. I didn't realize you were actually trying to understand what it is I
want. That is, however, what I want. Thanks.


Roderick Mann   rmann @ latencyzero.com.sansspam





Re: Build system for mod_webapp and Apache 2.0

2001-08-31 Thread Ryan Bloom

On Friday 31 August 2001 10:36, Pier Fumagalli wrote:
> > +TARGET="${SRCDIR}/apache-2.0"
> > +makefile="apache-2.0/Makefile"
> > +AC_MSG_RESULT([setting target module to... ${TARGET}])
> > +  ]
> > +)
> > +AC_SUBST(TARGET)
> > +
> > +dnl
>
> Wasn't APXS for 2.0 completely broken? That's what you said last time :)

It was.  I fixed it.  :)

> > LOCAL_HEADER([Configuring APR])
> > LOCAL_FILTEREXEC(
> > -  [./configure --enable-static --disable-shared --disable-threads],
> > +  [./configure --enable-static --disable-threads],
> >  ["APR configure"])
> > if ${TEST} "${ret}" -ne "0"
> > then
>
> Hmm... I'd like to rely on the APR code coming with Apache 2.0 instead of
> building our local copy with Apache 2.0... (I'll see what I can figure out,
> hoping that 2.0 works on my OS/X box :)

Oh, if that's what you want to do, I can make that happen.  Give me five minutes,
and you'll have a patch.  :-)

Ryan
__
Ryan Bloom  [EMAIL PROTECTED]
Covalent Technologies   [EMAIL PROTECTED]
--



Re: cvs commit: jakarta-tomcat-connectors/webapp/apache-2.0 Makefile.in

2001-08-31 Thread Ryan Bloom

On Friday 31 August 2001 10:32, Pier Fumagalli wrote:
> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > jfclere 01/08/29 07:29:29
> >
> > Modified:webapp   configure.in
> > Added:   webapp/apache-2.0 Makefile.in
> > Log:
> > Copy/add configure logic for Apache-2.0 from mod_jk.
> >
> > Revision  ChangesPath
> > 1.23  +12 -3 jakarta-tomcat-connectors/webapp/configure.in
>
> APXS is broken in Apache 2.0... We should rely on APRVARS...

I actually fixed APXS this last weekend, and I have used it many times
now to build mod_webapp.   :-)

Ryan

__
Ryan Bloom  [EMAIL PROTECTED]
Covalent Technologies   [EMAIL PROTECTED]
--



Re: Build system for mod_webapp and Apache 2.0

2001-08-31 Thread Pier Fumagalli

"Ryan Bloom" <[EMAIL PROTECTED]> wrote:

> 
> Hi everybody,  I'm new to the list, but for anybody who doesn't know me,
> I have been pretty active on httpd 2.0.

DOH! :) Hi Ryan :)

> I decided to port mod_webapp last week, and Pier committed the code for me,
> but the build system isn't there, so I am posting the build system now.

Cool... Thanks! :)

> This is currently working, although there seems to be some strangeness when
> Tomcat responds to mod_webapp.  I'll be looking into that over the next few
> days. I hope to be more active as time permits.  :-)

Uh... I've been awfully busy lately... Didn't have much time to keep track
of things either...

> The Makefile.in should be placed in
> jakarta-tomcat-connectors/webapp/apache-2.0
> 
> Thanks,
> 
> Ryan
> 
> Index: webapp/Makefile.in
> ===
> RCS file: /home/cvspublic/jakarta-tomcat-connectors/webapp/Makefile.in,v
> retrieving revision 1.15
> diff -u -d -b -w -u -r1.15 Makefile.in
> --- webapp/Makefile.in2001/08/06 22:21:521.15
> +++ webapp/Makefile.in2001/08/29 23:51:41
> @@ -62,6 +62,7 @@
> 
> LOCALDIRS = @TGTDIRS@ @TARGET@
> APRDIR = @APRDIR@
> +INSTALLDIR = @TARGET@
> 
> CFGS = @CONFIGFILES@ \
> @SRCDIR@/lib/pr_warp_defs.h \
> @@ -71,6 +72,8 @@
> 
> all: apr-all local-all
> 
> +install: local-install
> +
> clean: apr-clean local-clean
> 
> distclean: clean
> @@ -128,6 +131,19 @@
> $(ECHO) "Cleaning up $${DIR}..." ; \
> cd $${DIR} ; \
> $(MAKE) clean ; \
> +RET=$$? ; \
> +cd $(SRCDIR) ; \
> +if test "$${RET}" != "0" ; then \
> +exit $${RET} ; \
> +fi ; \
> +done
> +
> +local-install:
> +@for DIR in $(INSTALLDIR) ; do \
> +$(ECHO) "" ; \
> +$(ECHO) "Compiling sources in $${DIR}..." ; \
> +cd $${DIR} ; \
> +$(MAKE) install ; \
> RET=$$? ; \
> cd $(SRCDIR) ; \
> if test "$${RET}" != "0" ; then \
> Index: webapp/configure.in
> ===
> RCS file: /home/cvspublic/jakarta-tomcat-connectors/webapp/configure.in,v
> retrieving revision 1.22
> diff -u -d -b -w -u -r1.22 configure.in
> --- webapp/configure.in2001/08/06 22:48:451.22
> +++ webapp/configure.in2001/08/29 23:51:41
> @@ -214,6 +214,41 @@
> AC_SUBST(TARGET)
> 
> dnl --
> +dnl Process the --with-apxs2[=FILE] command line argument
> +dnl 
> --
> +AC_ARG_WITH(apxs2,
> +  [  --with-apxs2[=FILE]  build a shared Apache 2.0.x module.],
> +  [
> +if ${TEST} -n "${TARGET}"
> +then
> +  AC_MSG_ERROR([target already defined as ${TARGET}])
> +fi
> +
> +APXS="${withval}"
> +
> +if ${TEST} -z "${APXS}" ; then APXS="yes" ; fi
> +if ${TEST} "${APXS}" = "yes"
> +then
> +  AC_PATH_PROG(APXS,apxs,${PATH})
> +fi
> +
> +AC_MSG_CHECKING([if apxs is working])
> +${APXS} -q CC 2>&1 1>/dev/null
> +if ${TEST} ! "$?" -eq "0"
> +then
> +  AC_MSG_RESULT([no])
> +  AC_MSG_ERROR([apxs is unworkable])
> +fi
> +AC_MSG_RESULT([ok])
> +
> +TARGET="${SRCDIR}/apache-2.0"
> +makefile="apache-2.0/Makefile"
> +AC_MSG_RESULT([setting target module to... ${TARGET}])
> +  ]
> +)
> +AC_SUBST(TARGET)
> +
> +dnl 


Wasn't APXS for 2.0 completely broken? That's what you said last time :)

> --
> dnl Process the --with-apr=... command line argument
> dnl --
> AC_MSG_CHECKING([APR directory])
> @@ -253,7 +288,7 @@
> 
> LOCAL_HEADER([Configuring APR])
> LOCAL_FILTEREXEC(
> -  [./configure --enable-static --disable-shared --disable-threads],
> +  [./configure --enable-static --disable-threads],
>  ["APR configure"])
> if ${TEST} "${ret}" -ne "0"
> then

Hmm... I'd like to rely on the APR code coming with Apache 2.0 instead of
building our local copy with Apache 2.0... (I'll see what I can figure out,
hoping that 2.0 works on my OS/X box :)

Pier




Re: cvs commit: jakarta-tomcat-connectors/webapp/apache-2.0Makefile.in

2001-08-31 Thread Pier Fumagalli

"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> jfclere 01/08/29 07:29:29
> 
> Modified:webapp   configure.in
> Added:   webapp/apache-2.0 Makefile.in
> Log:
> Copy/add configure logic for Apache-2.0 from mod_jk.
> 
> Revision  ChangesPath
> 1.23  +12 -3 jakarta-tomcat-connectors/webapp/configure.in

APXS is broken in Apache 2.0... We should rely on APRVARS...

Pier




Re: Naming factory for generic java beans

2001-08-31 Thread Remy Maucherat

> Hi,
>
> I recently worked on getting a JDBC connection pool/DataSource working on
> Tomcat 4.0b7.  I was interested in trying out the
OracleConnectionCacheImpl
> which Oracle provides in their JDBC drivers.
>
> I eventually found out that the only way to make an instance of this class
> available from JNDI was to create my own Factory class for it.  It seemed
> to me like there should be a simpler way to do something like this so I
> created a factory class (BeanFactory) which can instantiate any class
which
> conforms to the JavaBeans spec (i.e. most classes...).

That looks like a good idea. Of course, in some cases, you'll probably still
need a custom factory.

> What would I have to do to contribute this class so it ships as a standard
> part of Tomcat?  The class has worked out well for my purposes but I am
not
> sure if the ClassLoader portion of the code is doing the right thing, I
copied
> it from one of the other factory classes in org.apache.naming.factory.

If the code builds and works, that's more than enough. If it's fine, then
I'll commit it.
Thanks !

> Using this class, I am able to make the Oracle DataSource implementation
> available to all my servlets using the following xml fragment in
server.xml
>
> 
>type="oracle.jdbc.pool.OracleConnectionCacheImpl"/>
>   
> 
>   factory
>   org.apache.naming.factory.BeanFactory
> 
> driverTypethin
> serverNamehue
> networkProtocoltcp
> databaseName
> portNumber
> user
> password
> maxLimit5
>   
> 

Looks good. I'll add the example to the Javadoc header of the factory.

Remy




Naming factory for generic java beans

2001-08-31 Thread aner

Hi,

I recently worked on getting a JDBC connection pool/DataSource working on
Tomcat 4.0b7.  I was interested in trying out the OracleConnectionCacheImpl
which Oracle provides in their JDBC drivers.

I eventually found out that the only way to make an instance of this class
available from JNDI was to create my own Factory class for it.  It seemed
to me like there should be a simpler way to do something like this so I
created a factory class (BeanFactory) which can instantiate any class which
conforms to the JavaBeans spec (i.e. most classes...).

What would I have to do to contribute this class so it ships as a standard
part of Tomcat?  The class has worked out well for my purposes but I am not
sure if the ClassLoader portion of the code is doing the right thing, I copied
it from one of the other factory classes in org.apache.naming.factory.

Using this class, I am able to make the Oracle DataSource implementation
available to all my servlets using the following xml fragment in server.xml


  
  

  factory
  org.apache.naming.factory.BeanFactory

driverTypethin
serverNamehue
networkProtocoltcp 
databaseName
portNumber
user
password
maxLimit5
  


Similarly, you could make ANY JavaBean available from jndi using this factory.

I have attached my implementation to this message if anybody is interested in
getting it incorporated into Tomcat.

Thanks,

- Aner

package org.apache.naming.factory;

import java.util.Hashtable;
import java.util.Enumeration;
import javax.naming.Name;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.Reference;
import javax.naming.RefAddr;
import javax.naming.spi.ObjectFactory;
import org.apache.naming.ResourceRef;

import java.beans.Introspector;
import java.beans.BeanInfo;
import java.beans.PropertyDescriptor;

import java.lang.reflect.Method;

/**
 * Object factory for any Object conforming to the JavaBean spec.
 */

public class BeanFactory
implements ObjectFactory {

// --- Constructors


// -- Constants


// - Instance Variables


// - Public Methods


// -- ObjectFactory Methods


/**
 * Create a new Bean instance.
 * 
 * @param obj The reference object describing the Bean
 */
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable environment)
throws NamingException {
System.out.println("BeanFactory.getObjectInstance()");
if (obj instanceof ResourceRef) {
try {

Reference ref = (Reference) obj;
String beanClassName = ref.getClassName();
Class beanClass = null;
ClassLoader tcl = 
Thread.currentThread().getContextClassLoader();
if (tcl != null) {
try {
beanClass = 
tcl.loadClass(beanClassName);
} catch(ClassNotFoundException e) {
 }
} else {
try {
beanClass = 
Class.forName(beanClassName);
} catch(ClassNotFoundException e) {
e.printStackTrace();
}
}
if(beanClass == null)
throw new NamingException("Class not found: "
+ beanClassName);

BeanInfo bi = Introspector.getBeanInfo(beanClass);
PropertyDescriptor[] pda = bi.getPropertyDescriptors();

Object bean = beanClass.newInstance();

Enumeration e = ref.getAll();
while(e.hasMoreElements()) {
RefAddr ra = (RefAddr) e.nextElement();
String propName = ra.getType();
if(propName.equals(Constants.FACTORY) ||
propName.equals("scope") || 
propName.equals("auth"))
continue;
String value = (String)ra.getContent();

Object[] valueArray = new Object[1];

  

Re: Request: binary mod_webapp.so for Solaris built with -DEAPI

2001-08-31 Thread Pier Fumagalli

"Eryq" <[EMAIL PROTECTED]> wrote:

> I was using the mod_webapp.so connector for Solaris
> which I downloaded from apache.org
> All was going well until I rebuilt my Apache (1.3.20)
> with SSL support.  Now I get:
> 
> [warn] Loaded DSO libexec/mod_webapp.so uses plain Apache 1.3 API,
> this module might crash under EAPI! (please recompile it with -DEAPI)
> 
> Well, I didn't compile it, so I can't recompile it.
> I expect that a number of other users will be in the same boat.
> 
> Is there any compelling reason not to build with -DEAPI?
> What will really happen if this mod_webapp.so is used?

It will happen that the NON-EAPI server will complain because of unresolved
dependancies... :(

Pier




Re: TC323 standalone/ajp13 & thread pools

2001-08-31 Thread Christopher Cain


Bill Lipa wrote:
> 
> How many Apache children do you have?

Hehe ...

I don't have any myself, but there are two in my neighborhood: "Dances
With Pokemon" and "Running Rugrat". Those damn kids are always playing
around in the steet in full head-dress, which incidentally freaks out
the neighborhood cats. :)

- Christopher



Re: Extending Server.xml configurability (foradditionalclasspaths)

2001-08-31 Thread Christopher Cain

This entire thread has grown tiresome, my own posts included =)

Look, if you want shared classes for multiple webapps, but not all
webapps, then:

1) Create a common directory outside of TC
2) Put the jars there
3) Create symlinks to the jars in the relevant WEB-INF/lib subdiretories

It can be done without even touching the TC code. Modifying the
container to get this "functionality" is silly. If there are
shared-resource/threading issues, then separate jars are required
anyway. This approach will not work for classes, but just throw the
classes in a jar. I really don't understand the issue here. That
creating a few symlinks is somehow messier than needlessly hacking the
container, then trying to maintain that hack every time a new TC is
released?

Paul, like a few others, was obviously just trying to understand what
you were after, and the tone of your reply is completely unnecessary.
Quite frankly, I don't blame him for being confused, because the
question is confusing in its assertation ... what you want can be easily
done without hacking. If you have that much spare time, and enough
distaste for symlinks to make unnecessary hacks, then go for it.

- Christopher

Rick Mann wrote:
> 
> on 8/30/01 11:36 PM, Paul Speed at [EMAIL PROTECTED] wrote:
> 
> > Just clarifying, you basically want the exact same functionality
> > you'd get by copying the jars into the individual webapp lib
> > directories, but you just don't want to have to copy them.  Right?
> 
> Look, if it were the exact same functionality as copying the classes/jars
> into the individual webapp's folders, then that's what I'd do.
> 
> However, it's not the same thing. It makes deployment and development more
> difficult, despite the possibility of creating scripts or ant files to
> automate this process, it's still not as easy as being able to put the
> classes in one place once.
> 
> If it makes you happy, yes. I want the exact same functionality as copying a
> set of class files/jar files into a subset of installed webapp's directories
> without copying them or making links from one dir to another.
> 
> 
> Roderick Mann   rmann @ latencyzero.com.sansspam

-- 
- Christopher

/**
 * Pleurez, pleurez, mes yeux, et fondez vous en eau!
 * La moitié de ma vie a mis l'autre au tombeau.
 *---Cornelle
 */



Patch for mod_webapp Java

2001-08-31 Thread Dave Oxley

WarpConnector.java in jakarta-tomcat-connectors/webapp/java does not 
compile. I have fixed it and a patch is supplied. Can someone check it over 
and check it in.

Thanks.
Dave.



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

 patch


RE: PATCH: jk_nt_service can't automatically be restarted by Windows Service Control Manager upon crash

2001-08-31 Thread Brian Enright

Way to go Dave!

-Original Message-
From: Marc Saegesser [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 10:26 PM
To: [EMAIL PROTECTED]
Cc: Chien-Ming Huang; Brian Enright; Rob Webb; Patti Vrobel; Steven
Velez
Subject: RE: PATCH: jk_nt_service can't automatically be restarted by
Windows Service Control Manager upon crash


The patch looks good and seems to work OK after I configured my tomcat
service to attempt restarts on failures.  I hacked Tomcat to croak on start
up and the SCM correctly attempted a single restart and then quit.

The patch has been committed.  The native code doesn't get built for the
nightly builds so this won't show up in a distribution until Tomcat 3.2.4
(and I haven't worked out a schedule for that yet).


Marc Saegesser

> -Original Message-
> From: Dave Ringoen [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 4:55 PM
> To: '[EMAIL PROTECTED]'
> Cc: Chien-Ming Huang; Brian Enright; Rob Webb; Patti Vrobel; Steven
> Velez
> Subject: PATCH: jk_nt_service can't automatically be restarted by
> Windows Service Control Manager upon crash
>
>
> We're using Tomcat at our company with considerable success, but
> discovered
> that if java.exe crashes for some reason, the Tomcat service won't
> restart
> automatically.
>
> I diagnosed the problem and came up with this discovery and a proposed
> fix.
>
> jk_nt_service.exe exits too gracefully if the java.exe process dies,
> notifying the Service Control Manager that it is shutting down. When
> Service
> Control Manager receives the shutdown message, it does not restart the
> service. It assumes that the service was supposed to be shut down.
>
> This patch makes jk_nt_service exit more abruptly without notifying SCM.
> With this patch, SCM will correctly initiate a restart of the Tomcat
> service.
>
> I couldn't file this in Bugzilla because Bugzilla was down.
>
> Thanks for your consideration on this patch. I'm very impressed with the
> Tomcat development approach and process.
>
> Dave Ringoen
> Alventive, Inc.
>
>
> cvs diff -u jk_nt_service.c (in directory
> C:\Temp\tomcatsrcnightly\jakarta-tomcat\src\native\mod_jk\nt_service)
> Index: jk_nt_service.c
> ===
> RCS file:
> /home/cvspublic/jakarta-tomcat/src/native/mod_jk/nt_service/jk_nt_servic
> e.c,
> v
> retrieving revision 1.3
> diff -u -r1.3 jk_nt_service.c
> --- jk_nt_service.c   2001/04/24 08:49:46 1.3
> +++ jk_nt_service.c   2001/08/30 18:05:02
> @@ -535,6 +535,11 @@
>  /*
>   * Tomcat died !!!
>   */
> +CloseHandle(hServerStopEvent);
> +CloseHandle(hTomcat);
> +exit(0); // exit ungracefully so
> + // Service Control Manager
> + // will attempt a restart.
>  break;
>  default:
>  /*
>



Re: Fw: Bug in ServletResponse.flushBuffer() in Tomcat 4.0b7?

2001-08-31 Thread Jonathan Eric Miller

Thanks Craig. I think one of the other developers replied to me regarding
this issue awhile back. You are correct. It does seem to be working
correctly. I found out that Internet Explorer does some buffering on the
client-side and that was what caused the problem. Someone told me that you
have to send at least 256 characters to IE before it will display. I tested
that, and that does indeed seem to be what's happening.

Thanks, Jon

- Original Message -
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Tomcat Developer List" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 4:35 PM
Subject: Re: Fw: Bug in ServletResponse.flushBuffer() in Tomcat 4.0b7?


>
>
> On Tue, 21 Aug 2001, Jonathan Eric Miller wrote:
>
> > Date: Tue, 21 Aug 2001 10:47:11 -0500
> > From: Jonathan Eric Miller <[EMAIL PROTECTED]>
> > Reply-To: [EMAIL PROTECTED]
> > To: Tomcat Developer List <[EMAIL PROTECTED]>
> > Subject: Fw: Bug in ServletResponse.flushBuffer() in Tomcat 4.0b7?
> >
> > I originally posted this to the tomcat-user list, but, I received no
> > response. As far as I can tell, it's a bug, so, I'm now forwarding this
to
> > the developer list in hopes that someone here might be able to confirm
> > whether this is a bug or not.
> >
> > If you know the answer and respond, please respond to me directly or
post to
> > the user list as I am not on this list.
> >
> > Thanks a lot. I think you guys are doing a great job. It's just a few
small
> > issues like this that I hope to resolve at this point.
> >
> > Jon
> >
>
> Jon,
>
> I tried this with Tomcat 4.0 stand alone (current CVS code, Linux, JDK
> 1.3.1) and it works exactly as you expect -- you see the first part of the
> output, followed by a ten-second delay, followed by the second part.  (Of
> course, I had to put the Thread.sleep() call into a try/catch block.)
>
> As you undoubtedly noticed, the HTML that you emit before the flush has to
> be completed paragraphs or other elements -- otherwise the characters will
> still get buffered inside the browser itself.  One way to ensure that the
> browser is not messing you up is to do a telnet connection:
>
>   telnet localhost 8080
>
> and type
>
>   GET /myapp/servlet/SimpleServlet HTTP/1.0
>
> followed by a carriage return (^M) and line feed (^J).
>
> Craig
>
>




TC 3.2.2 jsp output refresh problem

2001-08-31 Thread David Cao

Hello,

I found a very strange problem us TC 3.2.2, if I update one of the jsp
page (using JavaBean), this page display fine, and after I went to
another page, and link back to the first page, then it display an old
page (before I change), if i refresh the screen, it will display new
value. 

So seems somethinking is wrong with refresh check. This happened in an
windows NT 4 computer.

Does any one count this problem before? or it's just a configuration
issue?

Any help is appreciate.

David



RE: TC323 standalone/ajp13 & thread pools

2001-08-31 Thread Bill Lipa


--- Marcus Crafter <[EMAIL PROTECTED]> wrote:

>   So if I understand you correctly, we should have our Tomcat pool size
>   set to the same as the MaxClients setting we have for Apache - as a
>   general rule ?
> 
>   We'll retest with these settings. Thanks very much for your advice. :-)
> 

I think you should leave a little margin in case some threads are used for
other things.  In our production environment, we have MaxClients set to 256,
and the size of the Tomcat thread pool set to 300.

Henri Gomez also says that if worker.ajp13.cachesize is set > 1, Tomcat may
need even more threads.  This is not the default setting, however.

Bill


__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com



RE: TC 3.3 Mod_jk chunked input encoding

2001-08-31 Thread Larry Isaacs

+1 as well.

Larry

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 31, 2001 11:28 AM
> To: [EMAIL PROTECTED]
> Subject: Re: TC 3.3 Mod_jk chunked input encoding
> 
> 
> On Wed, 29 Aug 2001, Keith Wannamaker wrote:
> 
> > This patch enables chunked input through mod_jk:
> > http://www.apache.org/~keith/jk/
> >
> > I think they are rather minor changes.
> >
> > Please review, discuss, and throw everything you have
> > at it.  If Larry approves I will commit this (or an
> 
> Hi Keith,
> 
> I'm +1 for the patch.
> 
> My main concern ( and what I've looked for ) is to not brake 
> anything that
> worked - and from your changes it seems the case where 
> Content-Length is
> present will work exactly as it did before.
> 
> If possible, please also update j-t-c. ( we can do that later 
> if you don't
> have time, but please check in the main branch soon - so we 
> can have it in
> the next beta )
> 
> Costin
> 



Re: Session problems in Apache.

2001-08-31 Thread Rainer Jung

Hi,

which Tomcat-Version do you use? Everything before 3.2.3 has a serious bug 
in a pool-Utility which leads to several problem, one of them is breaking 
the relation between requests and responses. That one is fixed in 3.2.3, 
but maybe its related to your problem.

You should give more technical details about your setup.

Rainer Jung


At 12:01 27.08.01 , you wrote:
>Hi.
>
>We are developing a crucial site with payment options.
>
>We need to do server side session handling a lot.
>We have implemented the same using JSP/Bean and default sessionobjects of
>the webserver.  We assume that the implementation is correct.  The Webserver
>is Apache/tomcat.
>
>But when the load increases, say beyond 100 simultaneous users, we find that
>part of the variables between sessions swap.
>
>We want to know what can be done.
>Are there any parameters to be set in the webserver???
>
>
>M.S. Anand.




RE: TC323 standalone/ajp13 & thread pools

2001-08-31 Thread Bill Lipa

How many Apache children do you have?  The default is 256, which will indeed
almost immediately consume all the threads in the Tomcat thread pool if you do
not increase it.  Each Apache child uses a thread.

With ajp13, what counts is really the number of Apache children that are
active.  You can easily count them with the Apache status mod or by using ps.

It is really a "buglet" that the Tomcat thread default is set lower than the
Apache default.

Bill


--- GOMEZ Henri <[EMAIL PROTECTED]> wrote:
> >Hi (.*),
> >
> > Hope all is well around the globe.
> >
> > We've been doing some stress testing here with Tomcat 
> >3.2.3 operating
> > in standalone mode and with apache via the mod_jk ajp13 
> >connector.
> >
> > We've noticed something interesting which we're not sure about.
> >
> > Tomcat running our application standalone can handle 70 
> >simultaneous
> > users, with a TcpPoolConnector thread pool set to 150. 
> >When we run the
> > same test via Apache/ajp13, the thread pool is quickly exhausted
> > (logged in tomcat.log)
> 
> You may have find something interesting. 
> 
> Could you check via netstat in that situation how many ajp connections
> are in CLOSE-WAIT ?
> 
> > Is this normal operation ? Should an ajp13 connector 
> >consume more tomcat threads than standalone tomcat ?
> 
> http native connector (HTTP/1.0) close connection at end of
> request. In ajp13 the connections between apache and tomcat
> are persistant. What I didn't understand is how you could 
> have 150 ajp13 connections to handle only 70 clients ?
>   
> Stay tuned


__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com



FW: Bug database. Tomcat header parsing errors

2001-08-31 Thread Pier Fumagalli

The bug database switchboard says...

Pier

-- Forwarded Message
> From: Jørgen Nørgaard <[EMAIL PROTECTED]>
> Date: Fri, 31 Aug 2001 12:58:09 +0200
> To: [EMAIL PROTECTED]
> Subject: Bug database. Tomcat header parsing errors
> 
> Hi,
> 
> it seems like tomcat (3.2.2) is too restrictive when parsing context length.
> A trailing blank appears to produce an error message, see example
> (notice trailing blank):
> 2001-08-24 12:09:09 - ContextManager: Error reading request, ignored -
> java.lang.NumberFormatException: 3379
>   at java.lang.Integer.parseInt(Integer.java:414)
>   at java.lang.Integer.parseInt(Integer.java:454)
>   at 
> org.apache.tomcat.core.RequestImpl.getContentLength(RequestImpl.java:284)
>   at 
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpCon
> nectionHandler.java:197)
>   at 
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>   at 
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
>   at java.lang.Thread.run(Thread.java:484)
> 
> 
> According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4,
> (leading &) trailing blanks are not part of the contents.
> 
> 
> Can you check if this is a known issue?
> 
> 
> Regards,
> 
> -- 
> /jørgen nørgaard
> mailto:[EMAIL PROTECTED]
> 
> 
> 
> 

-- End of Forwarded Message




Re: Realms and classloading + solution

2001-08-31 Thread Joachim Gjesdal

The solution was to let the common classloader be responsible for loading
LdapRealmPrincipal and LdapPrincipalUtil (a delegation class).
The catalina classloader is responsible for loading the LdapRealm class.

This way the both webapp classloader and the catalina classloader is able
to get hold of the LdapRealmPrincipal.

The delegation class is there just to avoid that the LdapRealmPrincipal
needs a reference back to to the LdapRealm (which is not accessible from
the common classloader).

joachim


Joachim Gjesdal wrote:

> I have a LdapRealm that extends RealmBase and a LdapPrincipal that
> implements Principal. These are loaded by the catalina classloader at
> startup in order to perform formbased authentication.When the user logs
> in and is authenticated by the ldap server, the LdapRealm creates a
> LdapPrincipal and stores it in the realm. Then a web application does a
> request.getUserPrincipal () to get the principal. This results in
> ClassCastException since the LdapPrincipal class is now loaded by the
> web applications classloader.
>
> Suggestions on how to solve this would be apprectiated,
>
> joachim gjesdal



NullPointerException in AdaptiveClassLoader

2001-08-31 Thread Andrej Rosenheinrich

Hello,

I posted this question once in the user-list, but got no reply. After 
getting no help and starting to look at the sourcecode this thing gets 
even more weird to me, so I hope you excuse that I now post it to the 
dev-list.

I broke down my question to a simple example. I have a html-page, 
calling a servlet and submitting one parameter. Calling this servlet I 
am getting:

Error: 500
Location: /aba2/test
Internal Servlet Error:
java.lang.NullPointerException at 
org.apache.tomcat.loader.AdaptiveClassLoader.loadClass 
(AdaptiveClassLoader.java:471) (pc 145) at 
org.apache.tomcat.loader.AdaptiveServletLoader.loadClass 
(AdaptiveServletLoader.java:174) (pc 18) at 
org.apache.tomcat.core.ServletWrapper.loadServlet 
(ServletWrapper.java:265) (pc 38) at 
org.apache.tomcat.core.ServletWrapper.init (ServletWrapper.java:289) (pc 
33) at org.apache.tomcat.core.Handler.service (Handler.java:254) (pc 19) 
at org.apache.tomcat.core.ServletWrapper.service 
(ServletWrapper.java:372) (pc 140) at 
org.apache.tomcat.core.ContextManager.internalService 
(ContextManager.java:797) (pc 250) at 
org.apache.tomcat.core.ContextManager.service (ContextManager.java:743) 
(pc 3) at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection 
(HttpConnectionHandler.java:210) (pc 388) at 
org.apache.tomcat.service.TcpWorkerThread.runIt 
(PoolTcpEndpoint.java:416) (pc 73) at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run 
(ThreadPool.java:498) (pc 132) at java.lang.Thread.run (Thread.java:484) 
(pc 11)

My servlet, the html-file, the web.xml file and server.xml-file are 
attached.

After having no idea at all what's going on I took a look at the 
sourcecode. First, I am using tomcat 3.2.1 under OpenVMS. Unfortunatly I 
couldnt get the code for version 3.2.1, only for 3.2.3. So I have to 
assume that the code for this class didnt change (did it?). Looking at 
the method loadClass in AdaptiveClassLoader I actually dont see a 
possible source for a NullPointerException. There can be a result value 
null, but nowhere a NullPointerException is thrown, as far as I looked 
at the statements in this method.

My questions: what can cause such an exception? did the class 
AdaptiveClassLoader change from 3.2.1 to 3.2.3? where is the point this 
exception is thrown?
Another question, under OpenVMS I have my doubts that an errormessage 
OutOfError is necessarily related to memory. What else can cause such an 
error? Bufferlimits? Processlimits? Is it possible/planned to give more 
specific errormessages? Is it possible to get involved in this project 
somehow?

Hope to not disturb anyone

Greetings, TIA
Andrej Rosenheinrich




















  



































   





  



















 



 

	


	
	


	
	




	


	
	
	










http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>



 test 
 Test 
 -2147483646 



 test 
 /test 




30







RE: TC 3.3 Mod_jk chunked input encoding

2001-08-31 Thread GOMEZ Henri

>I'm +1 for the patch.
>
>My main concern ( and what I've looked for ) is to not brake 
>anything that
>worked - and from your changes it seems the case where 
>Content-Length is
>present will work exactly as it did before.

Seems fine

>If possible, please also update j-t-c. ( we can do that later 
>if you don't
>have time, but please check in the main branch soon - so we 
>can have it in
>the next beta )

If Keith agree, I'll do the port to j-t-c since the code 
there has been seriously refactored ...



Re: TC 3.3 Mod_jk chunked input encoding

2001-08-31 Thread cmanolache

On Wed, 29 Aug 2001, Keith Wannamaker wrote:

> This patch enables chunked input through mod_jk:
> http://www.apache.org/~keith/jk/
>
> I think they are rather minor changes.
>
> Please review, discuss, and throw everything you have
> at it.  If Larry approves I will commit this (or an

Hi Keith,

I'm +1 for the patch.

My main concern ( and what I've looked for ) is to not brake anything that
worked - and from your changes it seems the case where Content-Length is
present will work exactly as it did before.

If possible, please also update j-t-c. ( we can do that later if you don't
have time, but please check in the main branch soon - so we can have it in
the next beta )

Costin




cvs commit: jakarta-tomcat/src/native/mod_jk/nt_service jk_nt_service.c

2001-08-31 Thread marcsaeg

marcsaeg01/08/31 06:53:41

  Modified:src/native/mod_jk/nt_service jk_nt_service.c
  Log:
  Porting changes to tomcat_32.
  
  If the Tomcat VM dies unexpectedly, jk_nt_service now terminates abruptly (i.e. 
without notifying the SCM).  This causes the NT service recovery process to attempt to 
restart the service (assuming the jk_nt_service has been configured for restarting).
  
  Submitted by: Dave Ringoen [[EMAIL PROTECTED]]
  
  Revision  ChangesPath
  1.4   +6 -1  jakarta-tomcat/src/native/mod_jk/nt_service/jk_nt_service.c
  
  Index: jk_nt_service.c
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/nt_service/jk_nt_service.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_nt_service.c   2001/04/24 08:49:46 1.3
  +++ jk_nt_service.c   2001/08/31 13:53:41 1.4
  @@ -56,7 +56,7 @@
   /***
* Description: NT System service for Jakarta/Tomcat   *
* Author:  Gal Shachor <[EMAIL PROTECTED]>   *
  - * Version: $Revision: 1.3 $   *
  + * Version: $Revision: 1.4 $   *
***/
   
   #include "jk_global.h"
  @@ -535,6 +535,11 @@
   /* 
* Tomcat died !!!
*/ 
  +CloseHandle(hServerStopEvent);
  +CloseHandle(hTomcat);
  +exit(0); // exit ungracefully so
  + // Service Control Manager 
  + // will attempt a restart.
   break;
   default:
   /* 
  
  
  



RE: PATCH: jk_nt_service can't automatically be restarted by Windows Service Control Manager upon crash

2001-08-31 Thread Marc Saegesser

Costin,

Sure, I'll take care of it today.


Marc Saegesser 

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 31, 2001 12:13 AM
> To: [EMAIL PROTECTED]
> Subject: RE: PATCH: jk_nt_service can't automatically be restarted by
> Windows Service Control Manager upon crash
> 
> 
> On Thu, 30 Aug 2001, Marc Saegesser wrote:
> 
> > The patch looks good and seems to work OK after I configured my tomcat
> > service to attempt restarts on failures.  I hacked Tomcat to 
> croak on start
> > up and the SCM correctly attempted a single restart and then quit.
> 
> Hi Marc,
> 
> Could you check it in the main branch too ?
> 
> Costin



cvs commit: jakarta-tomcat-connectors/jk/native configure.in

2001-08-31 Thread jfclere

jfclere 01/08/31 05:16:57

  Modified:jk/native configure.in
  Log:
  remove the last rm...
  
  Revision  ChangesPath
  1.11  +1 -2  jakarta-tomcat-connectors/jk/native/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/configure.in,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- configure.in  2001/08/31 10:37:42 1.10
  +++ configure.in  2001/08/31 12:16:56 1.11
  @@ -1,7 +1,7 @@
   dnl
   dnl Process this file with autoconf to produce a configure script
   dnl
  -AC_REVISION($Id: configure.in,v 1.10 2001/08/31 10:37:42 jfclere Exp $)dnl
  +AC_REVISION($Id: configure.in,v 1.11 2001/08/31 12:16:56 jfclere Exp $)dnl
   
   AC_PREREQ(2.13)
   AC_INIT(common/jk_ajp13.h)
  @@ -82,7 +82,6 @@
   
   dnl test apache version
   APA=`${GREP} STANDARD20 ${APXS}`
  -$RM -rf test
   if ${TEST} -z "$APA" ; then
   WEBSERVER="apache-1.3"
   else
  
  
  



Re: Realms and classloading

2001-08-31 Thread Joachim Gjesdal

... forgot to say: I run tomcat 4.0-B7.

Joachim Gjesdal wrote:

> I have a LdapRealm that extends RealmBase and a LdapPrincipal that
> implements Principal. These are loaded by the catalina classloader at
> startup in order to perform formbased authentication.When the user logs
> in and is authenticated by the ldap server, the LdapRealm creates a
> LdapPrincipal and stores it in the realm. Then a web application does a
> request.getUserPrincipal () to get the principal. This results in
> ClassCastException since the LdapPrincipal class is now loaded by the
> web applications classloader.
>
> Suggestions on how to solve this would be apprectiated,
>
> joachim gjesdal



cvs commit: jakarta-tomcat-connectors/jk/native configure.in

2001-08-31 Thread jfclere

jfclere 01/08/31 03:37:42

  Modified:jk/native configure.in
  Log:
  Improve the testing of the apache version (forgotten in previous commit!).
  
  Revision  ChangesPath
  1.10  +2 -4  jakarta-tomcat-connectors/jk/native/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/configure.in,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- configure.in  2001/07/06 16:39:16 1.9
  +++ configure.in  2001/08/31 10:37:42 1.10
  @@ -1,7 +1,7 @@
   dnl
   dnl Process this file with autoconf to produce a configure script
   dnl
  -AC_REVISION($Id: configure.in,v 1.9 2001/07/06 16:39:16 jfclere Exp $)dnl
  +AC_REVISION($Id: configure.in,v 1.10 2001/08/31 10:37:42 jfclere Exp $)dnl
   
   AC_PREREQ(2.13)
   AC_INIT(common/jk_ajp13.h)
  @@ -81,9 +81,7 @@
   fi
   
   dnl test apache version
  -$RM -rf test
  -$APXS -n test -g
  -APA=`grep STANDARD20 test/mod_test.c`
  +APA=`${GREP} STANDARD20 ${APXS}`
   $RM -rf test
   if ${TEST} -z "$APA" ; then
   WEBSERVER="apache-1.3"
  
  
  



Realms and classloading

2001-08-31 Thread Joachim Gjesdal

I have a LdapRealm that extends RealmBase and a LdapPrincipal that
implements Principal. These are loaded by the catalina classloader at
startup in order to perform formbased authentication.When the user logs
in and is authenticated by the ldap server, the LdapRealm creates a
LdapPrincipal and stores it in the realm. Then a web application does a
request.getUserPrincipal () to get the principal. This results in
ClassCastException since the LdapPrincipal class is now loaded by the
web applications classloader.

Suggestions on how to solve this would be apprectiated,

joachim gjesdal



cvs commit: jakarta-tomcat-connectors/webapp/apache-2.0 Makefile.in

2001-08-31 Thread jfclere

jfclere 01/08/31 03:26:24

  Modified:webapp   Makefile.in configure.in
   webapp/apache-1.3 Makefile.in
   webapp/apache-2.0 Makefile.in
  Log:
  Merge Ryan's changes with mines.
  
  Revision  ChangesPath
  1.16  +17 -1 jakarta-tomcat-connectors/webapp/Makefile.in
  
  Index: Makefile.in
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/Makefile.in,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Makefile.in   2001/08/06 22:21:52 1.15
  +++ Makefile.in   2001/08/31 10:26:24 1.16
  @@ -56,12 +56,13 @@
   # = #
   
   # @author  Pier Fumagalli 
  -# @version $Id: Makefile.in,v 1.15 2001/08/06 22:21:52 pier Exp $
  +# @version $Id: Makefile.in,v 1.16 2001/08/31 10:26:24 jfclere Exp $
   
   include @SRCDIR@/Makedefs
   
   LOCALDIRS = @TGTDIRS@ @TARGET@
   APRDIR = @APRDIR@
  +INSTALLDIR = @TARGET@
   
   CFGS = @CONFIGFILES@ \
@SRCDIR@/lib/pr_warp_defs.h \
  @@ -71,6 +72,8 @@
   
   all: apr-all local-all
   
  +install: local-install
  +
   clean: apr-clean local-clean
   
   distclean: clean
  @@ -128,6 +131,19 @@
$(ECHO) "Cleaning up $${DIR}..." ; \
cd $${DIR} ; \
$(MAKE) clean ; \
  + RET=$$? ; \
  + cd $(SRCDIR) ; \
  + if test "$${RET}" != "0" ; then \
  + exit $${RET} ; \
  + fi ; \
  + done
  +
  +local-install:
  + @for DIR in $(INSTALLDIR) ; do \
  + $(ECHO) "" ; \
  + $(ECHO) "Installing from $${DIR}..." ; \
  + cd $${DIR} ; \
  + $(MAKE) install ; \
RET=$$? ; \
cd $(SRCDIR) ; \
if test "$${RET}" != "0" ; then \
  
  
  
  1.24  +4 -6  jakarta-tomcat-connectors/webapp/configure.in
  
  Index: configure.in
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/configure.in,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- configure.in  2001/08/29 14:29:29 1.23
  +++ configure.in  2001/08/31 10:26:24 1.24
  @@ -58,7 +58,7 @@
   dnl --
   dnl Author Pier Fumagalli 
   dnl Author Jon S. Stevens 
  -dnl Version $Id: configure.in,v 1.23 2001/08/29 14:29:29 jfclere Exp $
  +dnl Version $Id: configure.in,v 1.24 2001/08/31 10:26:24 jfclere Exp $
   dnl --
   
   dnl --
  @@ -206,10 +206,8 @@
   AC_SUBST(APXS_LIBS_SHLIB)
   AC_SUBST(APXS_PREFIX)
   
  -dnl test apache version (from mod_jk)
  -$RM -rf test
  -$APXS -n test -g
  -APA=`grep STANDARD20 test/mod_test.c`
  +dnl test apache version
  +APA=`${GREP} STANDARD20 ${APXS}`
   if  ${TEST} -z "$APA" ; then
 TARGET="${SRCDIR}/apache-1.3"
 makefile="apache-1.3/Makefile"
  @@ -262,7 +260,7 @@
   
   LOCAL_HEADER([Configuring APR])
   LOCAL_FILTEREXEC(
  -  [./configure --enable-static --disable-shared --disable-threads],
  +  [./configure --enable-static --disable-threads],
 ["APR configure"])
   if ${TEST} "${ret}" -ne "0"
   then
  
  
  
  1.10  +5 -1  jakarta-tomcat-connectors/webapp/apache-1.3/Makefile.in
  
  Index: Makefile.in
  ===
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/apache-1.3/Makefile.in,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Makefile.in   2001/08/09 20:06:49 1.9
  +++ Makefile.in   2001/08/31 10:26:24 1.10
  @@ -56,7 +56,7 @@
   # = #
   
   # @author  Pier Fumagalli 
  -# @version $Id: Makefile.in,v 1.9 2001/08/09 20:06:49 pier Exp $
  +# @version $Id: Makefile.in,v 1.10 2001/08/31 10:26:24 jfclere Exp $
   
   include @SRCDIR@/Makedefs
   
  @@ -72,6 +72,7 @@
   APXS_SYSCONFDIR =@APXS_SYSCONFDIR@
   APXS_LIBS_SHLIB =@APXS_LIBS_SHLIB@
   APXS_PREFIX =@APXS_PREFIX@
  +APXS =   @APXS@ 
   
   MODULE = mod_webapp.so
   
  @@ -93,6 +94,9 @@
mod_webapp.lo @SRCDIR@/lib/libwebapp.la \
$(LIBTOOL_LIBS) $(EXTRA_LIBS) @APRDIR@/libapr.la \
-o mod_webapp.so
  +
  +install: mod_webapp.so
  + $(APXS) -i mod_webapp.so
   
   clean:
@for ENTRY in *.o *.lo $(MODULE) .libs ; \
  
  
  
  1.2   +3 -20 jakarta-tomcat-connectors/webapp/apache-2.0/Makefile.in
  
  Index: Makefile.in
  

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Http10.java Http10Interceptor.java

2001-08-31 Thread hgomez

hgomez  01/08/31 02:45:50

  Modified:src/etc  server.xml
   src/share/org/apache/tomcat/modules/server Http10.java
Http10Interceptor.java
  Log:
  Add Server header in http 1.0 connector.
  For security purpose, use reportedname attribute
  to select name to be reported back to browser.
  An empty string will make no Server header sent
  
  Revision  ChangesPath
  1.88  +5 -1  jakarta-tomcat/src/etc/server.xml
  
  Index: server.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- server.xml2001/08/23 14:42:46 1.87
  +++ server.xml2001/08/31 09:45:50 1.88
  @@ -168,7 +168,11 @@
  
  +   port 
  +   reportedname - Server name to send back to browser
  +  by default report Tomcat Web Server ...
  +  set an empty string to avoid sending server header 
  +-->
   


Re: Extending Server.xml configurability (foradditionalclasspaths)

2001-08-31 Thread Paul Speed

I wasn't trying to be rude.  I was just summing up a fairly large
discussion that touched on everything from classloader sharing to 
security to where any changes would reside.

You want several web apps to have access to the same jar file as
if each had their own private version, ie: no sharing of static data
or security permissions or any of that.

-Paul Speed

Rick Mann wrote:
> 
> on 8/30/01 11:36 PM, Paul Speed at [EMAIL PROTECTED] wrote:
> 
> > Just clarifying, you basically want the exact same functionality
> > you'd get by copying the jars into the individual webapp lib
> > directories, but you just don't want to have to copy them.  Right?
> 
> Look, if it were the exact same functionality as copying the classes/jars
> into the individual webapp's folders, then that's what I'd do.
> 
> However, it's not the same thing. It makes deployment and development more
> difficult, despite the possibility of creating scripts or ant files to
> automate this process, it's still not as easy as being able to put the
> classes in one place once.
> 
> If it makes you happy, yes. I want the exact same functionality as copying a
> set of class files/jar files into a subset of installed webapp's directories
> without copying them or making links from one dir to another.
> 
> 
> Roderick Mann   rmann @ latencyzero.com.sansspam



cvs commit: jakarta-tomcat-service/native/winnt/moni vdmonisvc.c

2001-08-31 Thread jfclere

jfclere 01/08/31 01:33:55

  Modified:native/winnt/moni vdmonisvc.c
  Log:
  Allow service restart by the Service Control Manager.
  Submitted by: Dave Ringoen [[EMAIL PROTECTED]] (for mod_jk TC3.x).
  
  Revision  ChangesPath
  1.2   +7 -2  jakarta-tomcat-service/native/winnt/moni/vdmonisvc.c
  
  Index: vdmonisvc.c
  ===
  RCS file: /home/cvs/jakarta-tomcat-service/native/winnt/moni/vdmonisvc.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- vdmonisvc.c   2001/08/09 16:32:24 1.1
  +++ vdmonisvc.c   2001/08/31 08:33:55 1.2
  @@ -165,7 +165,12 @@
   if (GetExitCodeProcess(ProcessInformation.hProcess, &qreturn)) {
 if (qreturn == STILL_ACTIVE) continue;
 }
  -AddToMessageLog(TEXT("ServiceStart: jsvc stopped"));
  +AddToMessageLog(TEXT("ServiceStart: jsvc crashed"));
  +CloseHandle(hServerStopEvent);
  +CloseHandle(ProcessInformation.hProcess);
  +exit(0); // exit ungracefully so
  + // Service Control Manager 
  + // will attempt a restart.
   break; //failed.
   }
   
  @@ -189,7 +194,7 @@
   CloseHandle(hServerStopEvent);
   
   if (ProcessInformation.hProcess)
  -   CloseHandle(ProcessInformation.hProcess);
  +CloseHandle(ProcessInformation.hProcess);
   
   }
   
  
  
  



Re: Build system for mod_webapp and Apache 2.0

2001-08-31 Thread jean-frederic clere

Ryan Bloom wrote:
> 
> On Thursday 30 August 2001 01:10, jean-frederic clere wrote:
> > Ryan Bloom wrote:
> > > Hi everybody,  I'm new to the list, but for anybody who doesn't know me,
> > > I have been pretty active on httpd 2.0.  I decided to port mod_webapp
> > > last week, and Pier committed the code for me, but the build system isn't
> > > there, so I am posting the build system now.
> > >
> > > This is currently working, although there seems to be some strangeness
> > > when Tomcat responds to mod_webapp.  I'll be looking into that over the
> > > next few days. I hope to be more active as time permits.  :-)
> > >
> > > The Makefile.in should be placed in
> > > jakarta-tomcat-connectors/webapp/apache-2.0
> >
> > Hi Ryan,
> >
> > I committed some code some hours before... I will try to merge the two.
> > I am detecting  Apache version using apxs thru the following code:
> > +++
> > dnl test apache version (from mod_jk)
> > $RM -rf test
> > $APXS -n test -g
> > APA=`grep STANDARD20 test/mod_test.c`
> > if  ${TEST} -z "$APA" ; then
> >   TARGET="${SRCDIR}/apache-1.3"
> >   makefile="apache-1.3/Makefile"
> > else
> >   TARGET="${SRCDIR}/apache-2.0"
> >   makefile="apache-2.0/Makefile"
> > fi
> > +++
> > Any comment? - I am using the same in mod_jk -
> 
> Doesn't this needlessly create a new directory on the machine?  And, it doesn't
> clean that dir until the next time you try to configure.  At the very least,
> we should execute the '$RM -rf test' command after the grep.  It would actually
> be possible to just do 'grep STANDARD20 $APXS'.  This is because
> the perl script actually has a copy of the module in it.  That is probably the
> cleanest solution.

Yes I will change mod_jk and  mod_webapp to do that way.

> 
> > I have also noted strange things mod_webapp always returns 500.
> > It seems the request is mapped (wam_match) correctly but the handler
> > (wam_invoke) is not called.
> > What is the problem you have detected?
> 
> It looks like when Tomcat returns a 302 through mod_webapp, we are
> redirected to a strange port.

I must have another problem then. ;-(

>  I haven't even begun to look at it yet, but I
> am hoping to have time either today or tomorrow.
> 
> Ryan
> __
> Ryan Bloom  [EMAIL PROTECTED]
> Covalent Technologies   [EMAIL PROTECTED]
> --