Re: [VOTE] Tomcat 4.0.2 b2 release
On Wed, 16 Jan 2002, Remy Maucherat wrote: > > [...] > > [ ] +1 Make the release > [X] +0 Good idea, but I can't help > [ ] -0 Bad idea > [ ] -1 No, because: > -bip -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java
bip 01/10/26 12:36:08 Modified:catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java Log: Update/Refactoring Revision ChangesPath 1.12 +54 -59 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java Index: SsiInvokerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- SsiInvokerServlet.java2001/10/24 00:03:04 1.11 +++ SsiInvokerServlet.java2001/10/26 19:36:08 1.12 @@ -1,8 +1,8 @@ /* * SsiInvokerServlet.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.11 2001/10/24 00:03:04 bip Exp $ - * $Revision: 1.11 $ - * $Date: 2001/10/24 00:03:04 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.12 2001/10/26 19:36:08 bip Exp $ + * $Revision: 1.12 $ + * $Date: 2001/10/26 19:36:08 $ * * * @@ -89,8 +89,8 @@ import javax.naming.InitialContext; import org.apache.catalina.Globals; import org.apache.catalina.util.RequestUtil; -import org.apache.catalina.util.ssi.SsiCommand; -import org.apache.catalina.util.ssi.SsiMediator; +import org.apache.catalina.util.ssi.SsiDispatcher; +import org.apache.catalina.util.ssi.SsiEnvironment; import org.apache.catalina.util.ssi.ServletOutputStreamWrapper; /** @@ -99,7 +99,7 @@ * * @author Bip Thelin * @author Amy Roh - * @version $Revision: 1.11 $, $Date: 2001/10/24 00:03:04 $ + * @version $Revision: 1.12 $, $Date: 2001/10/26 19:36:08 $ */ public final class SsiInvokerServlet extends HttpServlet { /** Debug level for this servlet. */ @@ -111,15 +111,14 @@ /** Expiration time in seconds for the doc. */ private Long expires = null; -/** Should we ignore unsupported/misspelled SSI Directives */ -private boolean ignoreUnsupportedDirective = false; +/** The SSI dispatcher for this servlet instance */ +private SsiDispatcher ssiDispatcher = null; -/** virtual path can be webapp-relative */ +/** + * virtual path can be webapp-relative + */ private boolean isVirtualWebappRelative = false; -/** The Mediator object for the SsiCommands. */ -private static SsiMediator ssiMediator = null; - /** The start pattern */ private final static byte[] bStart = { (byte)'<',(byte)'!',(byte)'-',(byte)'-',(byte)'#' @@ -137,7 +136,9 @@ * @exception ServletException if an error occurs */ public void init() throws ServletException { +ssiDispatcher = new SsiDispatcher(); String value = null; + try { value = getServletConfig().getInitParameter("debug"); debug = Integer.parseInt(value); @@ -154,7 +155,7 @@ try { value = getServletConfig().getInitParameter("ignoreUnsupportedDirective"); -ignoreUnsupportedDirective = Integer.parseInt(value) > 0 ? true : false; + ssiDispatcher.setIgnoreUnsupportedDirective((Integer.parseInt(value)>0)?true:false); } catch (Throwable t) { ; } @@ -226,7 +227,17 @@ ServletContext servletContext = getServletContext(); String path = getRelativePath(req); -URL resource = servletContext.getResource(path); +URL resource = servletContext.getResource(path); +SsiEnvironment ssiEnv = null; +StringBuffer command = new StringBuffer(); +byte buf[] = new byte[4096]; +int len = 0, bIdx = 0; +char ch; +boolean inside = false; +boolean disableOutput = false; +String strCmd; +String[] strParamType; +String[] strParam; if (debug > 0) log("SsiInvokerServlet.requestHandler()\n" + @@ -248,6 +259,11 @@ return; } +// Get the SsiEnvironment instance for this request. +ssiEnv = SsiEnvironment.createSsiEnvironment(servletContext, + req, res, path); +ssiEnv.setIsVirtualWebappRelative(isVirtualWebappRelative); + res.setContentType("text/html;charset=UTF-8"); if (expires != null) { @@ -255,39 +271,20 @@ new java.util.Date()).getTime() + expires.longValue() * 1000); } -OutputStream
cvs commit: jakarta-tomcat-4.0/tester/web/golden SSIInclude03.txt
bip 01/10/26 12:26:07 Modified:tester/web/golden SSIInclude03.txt Log: Revision ChangesPath 1.2 +1 -0 jakarta-tomcat-4.0/tester/web/golden/SSIInclude03.txt Index: SSIInclude03.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/tester/web/golden/SSIInclude03.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SSIInclude03.txt 2001/10/25 18:08:32 1.1 +++ SSIInclude03.txt 2001/10/26 19:26:07 1.2 @@ -1,3 +1,4 @@ This is Content of "includeme.txt" This is Content of "includeme.txt" + This is Content of "includeme.txt"
cvs commit: jakarta-tomcat-4.0/tester/web/golden SSIInclude03.txt
bip 01/10/25 11:08:32 Modified:tester/src/bin tester.xml Added: tester/web SSIInclude09.shtml tester/web/golden SSIInclude03.txt Log: Additional SSI tests, should fail for now until a problem with SSI has been resolved. This test exploits that bug. Submitted by: Paul Speed [pspeed progeeks.com] Revision ChangesPath 1.72 +4 -0 jakarta-tomcat-4.0/tester/src/bin/tester.xml Index: tester.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/tester/src/bin/tester.xml,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- tester.xml2001/10/15 22:39:06 1.71 +++ tester.xml2001/10/25 18:08:32 1.72 @@ -1632,6 +1632,10 @@ golden="${golden.path}/SSIInclude02.txt"/> + + 1.1 jakarta-tomcat-4.0/tester/web/SSIInclude09.shtml Index: SSIInclude09.shtml === 1.1 jakarta-tomcat-4.0/tester/web/golden/SSIInclude03.txt Index: SSIInclude03.txt === This is Content of "includeme.txt" This is Content of "includeme.txt" This is Content of "includeme.txt"
RE: DO NOT REPLY [Bug 4361] - SsiServlet potentially leaks files
> -Original Message- > From: Paul Speed [mailto:[EMAIL PROTECTED]] > > [...] > I now have this working on my system here. It currently passes all > of the tester tests in addition to about 7 more tests that I added > myself here locally. I also added the initial support for the "set" > directive and variable substitution. I have one more command to get > working and then some clean-up and I'll see about posting the diffs. > > Actually, while I'm on that subject, the diffs are extensive since > I've pretty much touched every SSI related file in a very significant > way... in addition to removing a few of them. What is the preferred > way to submit such a large patch? I don't know how much you have left but I'm going to be unavailable for the coming weeks starting from tomorrow. I'm relocating back to Sweden from San Francisco. So if you want/can you could send me the files today and I could try and integrate the changes before I take off. Bip Thelin
RE: DO NOT REPLY [Bug 4361] - SsiServlet potentially leaks files
> -Original Message- > From: Paul Speed [mailto:[EMAIL PROTECTED]] > > Actually, while I'm on that subject, the diffs are extensive since > I've pretty much touched every SSI related file in a very significant > way... in addition to removing a few of them. What is the preferred > way to submit such a large patch? Send them along as .zip or .tar.gz if they're *really* big maybe you could put them somewhere and send along the link. Bip
RE: DO NOT REPLY [Bug 4361] - SsiServlet potentially leaks files
> -Original Message- > From: Paul Speed [mailto:[EMAIL PROTECTED]] > > [...] > > Actually, includes should share the environment of the parent... > in fact, if they set server variables the parent will see them. Ok, that might be true(just looked at Apache's behavior and they seem to do just that), when we implemented SSI we strictly followed the NCSA standard which don't have set, and doesn't talk about if the included page should see commands set by the parent. God catch! > Cool. I'm almost done refactoring. I'm basically replacing the > SsiMediator with an SsiEnvironment that is then stuck into a > request attribute. In the process, I'm moving some things around > a little since all of the commands were relying on the fact that > they were SsiMediator subclasses... and therefore directly accessing > the static fields of SsiMediator. Ok, sounds good, send along some code and I can take a look at it and commit it. Bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java
bip 01/10/23 17:03:04 Modified:catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java Log: Some of the inputstream being used was not explicity closed. PR: 4361 Submitted by: rami.hanninen davisor.com Revision ChangesPath 1.11 +9 -6 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java Index: SsiInvokerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- SsiInvokerServlet.java2001/10/19 18:39:18 1.10 +++ SsiInvokerServlet.java2001/10/24 00:03:04 1.11 @@ -1,8 +1,8 @@ /* * SsiInvokerServlet.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.10 2001/10/19 18:39:18 bip Exp $ - * $Revision: 1.10 $ - * $Date: 2001/10/19 18:39:18 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.11 2001/10/24 00:03:04 bip Exp $ + * $Revision: 1.11 $ + * $Date: 2001/10/24 00:03:04 $ * * * @@ -99,7 +99,7 @@ * * @author Bip Thelin * @author Amy Roh - * @version $Revision: 1.10 $, $Date: 2001/10/19 18:39:18 $ + * @version $Revision: 1.11 $, $Date: 2001/10/24 00:03:04 $ */ public final class SsiInvokerServlet extends HttpServlet { /** Debug level for this servlet. */ @@ -285,7 +285,10 @@ while ((len = in.read(buf)) != -1) soonOut.write(buf, 0, len); -soonOut.close(); +try { in.close(); } catch (IOException e) { ; } +try { resourceInputStream.close(); } catch (IOException e) { ; } +try { soonOut.close(); } catch (IOException e) { ; } + byte[] unparsed = soonOut.toByteArray(); soonOut = null; buf = null; while (bIdx < unparsed.length) { @@ -335,7 +338,7 @@ if (buffered) ((ServletOutputStreamWrapper)out).writeTo(res.getOutputStream()); -out = null; +try { out.close(); } catch (IOException e) { ; } } /**
RE: DO NOT REPLY [Bug 4361] - SsiServlet potentially leaks files
> -Original Message- > From: Paul Speed [mailto:[EMAIL PROTECTED]] > > For the curious reader, after looking into this code at some length > it seems clear why the set command was not added. All SSI requests > share the same environment, which not only makes a set command > impossible but also means that multiple SSI requests (or even nested > SSI requests) trample all over each other. A simple shtml file that > includes two other shtml files illustrates this quite nicely. Do you have a smal testcase? We have unittests with Tomcat that have nested includes and several includes in one page. All Ssi directives share the same enviroment per page through a mediator, this is due to the fact that you can have a config directive that changes the error message that you would get for a failed include further down on the same page, for instance. However if pageA includes pageB, if pageB is also an shtml/ssi file it would have a new fresh enviroment and could not tamper with pageA's enviroment. So you could easily do a set command simmilar to the config command. > Since I'm between assignments at the moment, I'm working on a patch > here locally. It's pretty significant, though, so it may take me a > few days. It will include the set command though since that's what > I'm going to use to test it. :) Patches and additions are gladly appreciated. Bip Thelin
RE: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi SsiMediator.java
> -Original Message- > From: Remy Maucherat [mailto:[EMAIL PROTECTED]] > > Could you also commit these fixes to the 4.0 branch if you can ? done, I have a bunch of enhancements on my table that I'm gonna take care of as soon as possible, I'm in the process if relocating back to sweden so I haven't been that active commiting code lately. Regards, Bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi SsiMediator.java
bip 01/10/22 14:38:22 Modified:catalina/src/share/org/apache/catalina/util/ssi Tag: tomcat_40_branch SsiMediator.java Log: Bugfixes Revision ChangesPath No revision No revision 1.7.2.1 +9 -10 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java Index: SsiMediator.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- SsiMediator.java 2001/07/22 20:25:15 1.7 +++ SsiMediator.java 2001/10/22 21:38:22 1.7.2.1 @@ -1,8 +1,8 @@ /* * SsiMediator.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v 1.7 2001/07/22 20:25:15 pier Exp $ - * $Revision: 1.7 $ - * $Date: 2001/07/22 20:25:15 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v 1.7.2.1 2001/10/22 21:38:22 bip Exp $ + * $Revision: 1.7.2.1 $ + * $Date: 2001/10/22 21:38:22 $ * * * @@ -86,7 +86,7 @@ /** * @author Bip Thelin * @author Amy Roh - * @version $Revision: 1.7 $, $Date: 2001/07/22 20:25:15 $ + * @version $Revision: 1.7.2.1 $, $Date: 2001/10/22 21:38:22 $ * */ public class SsiMediator { @@ -404,13 +404,12 @@ }else if (path.indexOf('/', 1)==-1) { //root context servletContext = servletContext.getContext("/"); -} else if (!contextPath.equals("")) { +} else if (!contextPath.equals("") && + (normalized !=null) && (normalized.startsWith(contextPath))) { //starts with the context path of this webapp -if ((normalized !=null) && (normalized.startsWith(contextPath))) { -// strip off the context path -servletContext = servletContext.getContext(contextPath); -normalized = normalized.substring(contextPath.length()); -} +// strip off the context path +servletContext = servletContext.getContext(contextPath); +normalized = normalized.substring(contextPath.length()); } else if (normalized != null){ // find which context is the right one to handle String context = normalized.substring(0, path.indexOf('/', 1));
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java
bip 01/10/22 14:35:48 Modified:catalina/src/share/org/apache/catalina/servlets Tag: tomcat_40_branch SsiInvokerServlet.java Log: Bugfixes Revision ChangesPath No revision No revision 1.8.2.1 +23 -6 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java Index: SsiInvokerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -r1.8 -r1.8.2.1 --- SsiInvokerServlet.java2001/07/22 20:25:11 1.8 +++ SsiInvokerServlet.java2001/10/22 21:35:48 1.8.2.1 @@ -1,8 +1,8 @@ /* * SsiInvokerServlet.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.8 2001/07/22 20:25:11 pier Exp $ - * $Revision: 1.8 $ - * $Date: 2001/07/22 20:25:11 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.8.2.1 2001/10/22 21:35:48 bip Exp $ + * $Revision: 1.8.2.1 $ + * $Date: 2001/10/22 21:35:48 $ * * * @@ -99,7 +99,7 @@ * * @author Bip Thelin * @author Amy Roh - * @version $Revision: 1.8 $, $Date: 2001/07/22 20:25:11 $ + * @version $Revision: 1.8.2.1 $, $Date: 2001/10/22 21:35:48 $ */ public final class SsiInvokerServlet extends HttpServlet { /** Debug level for this servlet. */ @@ -111,6 +111,8 @@ /** Expiration time in seconds for the doc. */ private Long expires = null; +/** Should we ignore unsupported/misspelled SSI Directives */ +private boolean ignoreUnsupportedDirective = false; /** virtual path can be webapp-relative */ private boolean isVirtualWebappRelative = false; @@ -143,8 +145,19 @@ ; } -value = getServletConfig().getInitParameter("isVirtualWebappRelative"); -isVirtualWebappRelative = Integer.parseInt(value) > 0 ? true : false; +try { +value = getServletConfig().getInitParameter("isVirtualWebappRelative"); +isVirtualWebappRelative = Integer.parseInt(value) > 0 ? true : false; +} catch (Throwable t) { +; +} + +try { +value = getServletConfig().getInitParameter("ignoreUnsupportedDirective"); +ignoreUnsupportedDirective = Integer.parseInt(value) > 0 ? true : false; +} catch (Throwable t) { +; +} try { value = getServletConfig().getInitParameter("expires"); @@ -235,6 +248,8 @@ return; } +res.setContentType("text/html;charset=UTF-8"); + if (expires != null) { res.setDateHeader("Expires", ( new java.util.Date()).getTime() + expires.longValue() * 1000); @@ -306,6 +321,8 @@ out.write((ssiCommand.getStream(strParamType, strParam)).getBytes()); } else ssiCommand.process(strParamType, strParam); +} else if(ignoreUnsupportedDirective && ssiCommand==null) { +; } else { out.write(ssiMediator.getError()); }
cvs commit: jakarta-tomcat-4.0/catalina/src/conf web.xml
bip 01/10/22 14:28:55 Modified:catalina/src/conf Tag: tomcat_40_branch web.xml Log: SSI Additions Revision ChangesPath No revision No revision 1.22.2.6 +9 -1 jakarta-tomcat-4.0/catalina/src/conf/web.xml Index: web.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/web.xml,v retrieving revision 1.22.2.5 retrieving revision 1.22.2.6 diff -u -r1.22.2.5 -r1.22.2.6 --- web.xml 2001/10/12 19:55:26 1.22.2.5 +++ web.xml 2001/10/22 21:28:54 1.22.2.6 @@ -157,7 +157,11 @@ - + + + + + @@ -181,6 +185,10 @@ isVirtualWebappRelative 0 + + + ignoreUnsupportedDirective + 1 4
cvs commit: jakarta-tomcat-4.0/catalina/src/conf web.xml
bip 01/10/22 13:57:24 Modified:catalina/src/conf web.xml Log: additional information about the Ssi 'ignoreUnsupportedDirective' parameter. Revision ChangesPath 1.28 +5 -0 jakarta-tomcat-4.0/catalina/src/conf/web.xml Index: web.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/web.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- web.xml 2001/10/19 18:40:37 1.27 +++ web.xml 2001/10/22 20:57:24 1.28 @@ -137,6 +137,11 @@ + + + + +
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi SsiMediator.java
bip 01/10/22 13:47:42 Modified:catalina/src/share/org/apache/catalina/util/ssi SsiMediator.java Log: Fix for relativepath issues across contexts. PR: 4326 / 4307 Submitted by: [EMAIL PROTECTED] (Rami Hänninen) / [EMAIL PROTECTED] Revision ChangesPath 1.8 +9 -10 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java Index: SsiMediator.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SsiMediator.java 2001/07/22 20:25:15 1.7 +++ SsiMediator.java 2001/10/22 20:47:42 1.8 @@ -1,8 +1,8 @@ /* * SsiMediator.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v 1.7 2001/07/22 20:25:15 pier Exp $ - * $Revision: 1.7 $ - * $Date: 2001/07/22 20:25:15 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v 1.8 2001/10/22 20:47:42 bip Exp $ + * $Revision: 1.8 $ + * $Date: 2001/10/22 20:47:42 $ * * * @@ -86,7 +86,7 @@ /** * @author Bip Thelin * @author Amy Roh - * @version $Revision: 1.7 $, $Date: 2001/07/22 20:25:15 $ + * @version $Revision: 1.8 $, $Date: 2001/10/22 20:47:42 $ * */ public class SsiMediator { @@ -404,13 +404,12 @@ }else if (path.indexOf('/', 1)==-1) { //root context servletContext = servletContext.getContext("/"); -} else if (!contextPath.equals("")) { +} else if (!contextPath.equals("") && + (normalized !=null) && (normalized.startsWith(contextPath))) { //starts with the context path of this webapp -if ((normalized !=null) && (normalized.startsWith(contextPath))) { -// strip off the context path -servletContext = servletContext.getContext(contextPath); -normalized = normalized.substring(contextPath.length()); -} +// strip off the context path +servletContext = servletContext.getContext(contextPath); +normalized = normalized.substring(contextPath.length()); } else if (normalized != null){ // find which context is the right one to handle String context = normalized.substring(0, path.indexOf('/', 1));
RE: cvs commit: jakarta-tomcat-4.0/catalina/src/conf web.xml
Oups, seems my XML editor reformatted/reindented everything if anyone experiences problem or disslike it feel free to change it or let me know and I can roll back and reapply my changes. Bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java
bip 01/10/19 11:39:18 Modified:catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java Log: An addition that makes it possible to specify in web.xml if the SSI servlet should ignore unsupported/missspelled SSI Directives, set to false/0 by default. PR: 4261 Submitted by: [EMAIL PROTECTED] (Rami Hänninen) Revision ChangesPath 1.10 +21 -6 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java Index: SsiInvokerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- SsiInvokerServlet.java2001/10/18 19:01:14 1.9 +++ SsiInvokerServlet.java2001/10/19 18:39:18 1.10 @@ -1,8 +1,8 @@ /* * SsiInvokerServlet.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.9 2001/10/18 19:01:14 bip Exp $ - * $Revision: 1.9 $ - * $Date: 2001/10/18 19:01:14 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.10 2001/10/19 18:39:18 bip Exp $ + * $Revision: 1.10 $ + * $Date: 2001/10/19 18:39:18 $ * * * @@ -99,7 +99,7 @@ * * @author Bip Thelin * @author Amy Roh - * @version $Revision: 1.9 $, $Date: 2001/10/18 19:01:14 $ + * @version $Revision: 1.10 $, $Date: 2001/10/19 18:39:18 $ */ public final class SsiInvokerServlet extends HttpServlet { /** Debug level for this servlet. */ @@ -111,6 +111,8 @@ /** Expiration time in seconds for the doc. */ private Long expires = null; +/** Should we ignore unsupported/misspelled SSI Directives */ +private boolean ignoreUnsupportedDirective = false; /** virtual path can be webapp-relative */ private boolean isVirtualWebappRelative = false; @@ -143,8 +145,19 @@ ; } -value = getServletConfig().getInitParameter("isVirtualWebappRelative"); -isVirtualWebappRelative = Integer.parseInt(value) > 0 ? true : false; +try { +value = getServletConfig().getInitParameter("isVirtualWebappRelative"); +isVirtualWebappRelative = Integer.parseInt(value) > 0 ? true : false; +} catch (Throwable t) { +; +} + +try { +value = getServletConfig().getInitParameter("ignoreUnsupportedDirective"); +ignoreUnsupportedDirective = Integer.parseInt(value) > 0 ? true : false; +} catch (Throwable t) { +; +} try { value = getServletConfig().getInitParameter("expires"); @@ -308,6 +321,8 @@ out.write((ssiCommand.getStream(strParamType, strParam)).getBytes()); } else ssiCommand.process(strParamType, strParam); +} else if(ignoreUnsupportedDirective && ssiCommand==null) { +; } else { out.write(ssiMediator.getError()); }
RE: [VOTE] New Committer
> -Original Message- > From: Christopher Cain [mailto:[EMAIL PROTECTED]] > > I would like to nominate Patrick Luby <[EMAIL PROTECTED]> > for committer > status. His recent contributions include several > security-manager-related > patches and documentation help, and appears keen to tackle > the Admin Apps > functionality as well. I think he would make an excellent > addition to the team. > Votes please? +1 bienvenue à l'équipe! > /** > * Pleurez, pleurez, mes yeux, et fondez vous en eau! > * La moitié de ma vie a mis l'autre au tombeau. > *---Corneille > */
RE: DO NOT REPLY [Bug 4259] New: - SSI prosessing loses content-type information
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > [...] > SSI prosessing loses content-type information > >Summary: SSI prosessing loses content-type information >Product: Tomcat 4 >Version: 4.0 Final > Platform: Sun > OS/Version: Linux > Status: NEW > Severity: Critical > Priority: Other > Component: Catalina > AssignedTo: [EMAIL PROTECTED] > ReportedBy: [EMAIL PROTECTED] This should be fixed in the coming nightly build, 20011019 Bip Thelin
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java
bip 01/10/18 12:01:14 Modified:catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java Log: Changed the SsiInvokerServlet to always set the Content-type header information. Thanks to Rami Hanninen for submitting a bugreport. Submitted by: [EMAIL PROTECTED] PR: 4259 Revision ChangesPath 1.9 +6 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java Index: SsiInvokerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- SsiInvokerServlet.java2001/07/22 20:25:11 1.8 +++ SsiInvokerServlet.java2001/10/18 19:01:14 1.9 @@ -1,8 +1,8 @@ /* * SsiInvokerServlet.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.8 2001/07/22 20:25:11 pier Exp $ - * $Revision: 1.8 $ - * $Date: 2001/07/22 20:25:11 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v 1.9 2001/10/18 19:01:14 bip Exp $ + * $Revision: 1.9 $ + * $Date: 2001/10/18 19:01:14 $ * * * @@ -99,7 +99,7 @@ * * @author Bip Thelin * @author Amy Roh - * @version $Revision: 1.8 $, $Date: 2001/07/22 20:25:11 $ + * @version $Revision: 1.9 $, $Date: 2001/10/18 19:01:14 $ */ public final class SsiInvokerServlet extends HttpServlet { /** Debug level for this servlet. */ @@ -234,6 +234,8 @@ res.sendError(res.SC_NOT_FOUND, path); return; } + +res.setContentType("text/html;charset=UTF-8"); if (expires != null) { res.setDateHeader("Expires", (
RE: bugs to fix for tc4.0 final
> -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > > > I have reopened the bug, as jsp pages are not compiled > under windows > > 2000 using jdk 1.4b2 and tc 4.0b7. Under jdk 1.3.1, > everything works > > well. > > > > > > i suspect this is due to a change in the error reporting of the new > > javac compiler. > > > > Per the release plan, this is definitely on the "must be > addressed" list. I can not reproduce this bug. Here's my "java -version" java version "1.4.0-beta2" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77) Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode) I'm running Windows 2000, build 5.00.2195 Service Pack 2 -Bip
RE: [VOTE] Release Plan for Apache Tomcat 4.0 (final release)
> -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > > Please review this proposal, and the associated Bugzilla bug reports, and cast your vote: > > -- Release Plan for Apache Tomcat 4.0 (final release) -- > [X] +1I am in favor of this plan, and will help > [ ] +0I am in favor of this plan, but am unable to help > [ ] -0I not in favor of this plan > [ ] -1I am opposed to this plan, and my reason(s) are: +1 -Bip
RE: [VOTE] New Tomcat Committer
> -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > > As Jon informally did last week or so, I'd like to formally > propose Christopher Cain <[EMAIL PROTECTED]> as a > committer on Tomcat. He's contributed lots of useful > discussion, patches, and documentation (particularly in the > area of SSL-based things) and wants to do more. +1 -bip
RE: Addition of 'dirty' field to Session interface
> -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > > [...] > > * Load-balanced distributed container that can move sessions around > as various servers get overloaded. > > * Fail-safe distributed container that automatically recovers from > server failures and reconnects you to a different one with your > session intact. > > without the application developer having to worry about this > for his/her > session beans. The first case isn't so hard -- the only time > you have to > persist is when you are going to migrate, so you would just do it > unconditinally. The second case is harder, unless you can afford the > performance hit of persisting after *every* request. This is just an idea from the top of my head, would it be possible having a second vector that contains a footprint(not a full clone) of the object for a session and have a reaper thread checking the footprints against the "real" objects and determine if they changed or not and based on that replicate of whatever we want to do. Similar to how PersistentManager check sessions to determine if they should be swapped to disk or backed up. Or is this just plain dumb? -bip thelin
RE: [PATCH] TC4 shell Scripts
> -Original Message- > From: Stephane Bailliez [mailto:[EMAIL PROTECTED]] > > Fixed some bugs that prevented its use under cygwin. Can someone with cygwin try out the catalina.sh diff, I commited the digest.sh diff. Thanks, Bip Thelin
cvs commit: jakarta-tomcat-4.0/catalina/src/bin digest.sh
bip 01/08/20 11:36:04 Modified:catalina/src/bin digest.sh Log: Fix for cygwin. Submitted by: Stephane Bailliez [[EMAIL PROTECTED]] Revision ChangesPath 1.2 +14 -1 jakarta-tomcat-4.0/catalina/src/bin/digest.sh Index: digest.sh === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/bin/digest.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- digest.sh 2001/05/22 20:37:21 1.1 +++ digest.sh 2001/08/20 18:36:04 1.2 @@ -10,7 +10,7 @@ # This script is assumed to run from the bin directory or have the # CATALINA_HOME env variable set. # -# $Id: digest.sh,v 1.1 2001/05/22 20:37:21 bip Exp $ +# $Id: digest.sh,v 1.2 2001/08/20 18:36:04 bip Exp $ # - @@ -45,6 +45,19 @@ fi # - Set Up The System Classpath --- +# Cygwin support. $cygwin _must_ be set to either true or false. +case "`uname`" in + CYGWIN*) cygwin=true ;; + *) cygwin=false ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$CATALINA_HOME" ] && +CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"` +[ -n "$JAVA_HOME" ] && +JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi CP="$CATALINA_HOME/server/lib/catalina.jar"
RE: [VOTE] Sources in Binary Distributions
> -Original Message- > From: Pier P. Fumagalli [mailto:[EMAIL PROTECTED]] > > [...] > > [X] - +1 Remove the sources [I will help in the process, > meaning do the job] > [ ] - +0 Remove the sources [I can't help, won't help] > [ ] - -0 Leave the sources [But since I don't volunteer this > is not binding] > [ ] - -1 Are you nuts? Sources are there and there have to remain. -bip
RE: Sources in Binary Distributions
> -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > > [...] > Well, "ant dist" ***is*** how binary distributions (for both the nightly > builds and releases) are created, so this should not be too much of a > surprise :-). Oups, ignore my last post. ..bip
RE: Sources in Binary Distributions
> -Original Message- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > >[...] > For Tomcat 4, what do folks think of omitting the sources from the binary > distribution? This would knock the size of the binary distributions down > by around 2 megabytes (which I'm sure people would also appreciate). +1 And also update the build.xml to omitt the sources when compiling with target dist. ..bip
RE: [DOC] Resend of ROOT/index.html
> -Original Message- > From: Rob S. [mailto:[EMAIL PROTECTED]] > > [...] > Here's my take on a new default index.html along with the jakarta banner > since I've incorporated that in as well. I'd like it if all of the sample > apps retained a somewhat similar look and feel (volunteering if people agree > that it should be done). I tried this page under Opera and IE and it works > fine. I'm scared to try NS! =) I've tried it in NS and it works fine. > I'd really like the default apps to showcase Tomcat, and they've always been > kind of clunky. IIRC, some of the JSP/Servlet example links don't work > correctly. I'd also like the default homepage to brag about the features of > Tomcat to some degree, e.g. session persistence and whatnot, but I don't > know enough about these things yet... > > Of course, by mentioning this I'm implicitly volunteering to do it ;) Sounds great, If you feel like giving the default apps a more appealing look that goes well with what you just submitted I don't think anyone would disagree with updating them. Bip Thelin
cvs commit: jakarta-tomcat-4.0/webapps/ROOT jakarta-banner.gif index.html
bip 01/07/27 10:38:17 Modified:webapps/ROOT index.html Added: webapps/ROOT jakarta-banner.gif Log: New design on the default landing page, thanks to Rob S <[EMAIL PROTECTED]> Submitted by: Rob S <[EMAIL PROTECTED]> Revision ChangesPath 1.22 +150 -69 jakarta-tomcat-4.0/webapps/ROOT/index.html Index: index.html === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/ROOT/index.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- index.html2001/07/20 06:14:10 1.21 +++ index.html2001/07/27 17:38:17 1.22 @@ -1,74 +1,155 @@ - +http://www.w3.org/TR/REC-html40/strict.dtd";> - - - - -Tomcat (v4.0-b7-dev) + + +Jakarta Project - Tomcat (v4.0-b6-dev) + + <!-- +body { +color: #00; +background-color: #FF; +font-family: Arial, "Times New Roman", Times; +font-size: 16px; +} + +A:link { +color: blue +} + +A:visited { +color: blue +} + +td { +color: #00; +font-family: Arial, "Times New Roman", Times; +font-size: 16px; +} + +.code { +color: #00; +font-family: "Courier New", Courier; +font-size: 16px; +} + --> + - -Tomcat + + + + + + +http://jakarta.apache.org/tomcat/index.html";> + + +Tomcat +Version 4.0-b6-dev + + +http://jakarta.apache.org/";> + + + -Version -4.0-b7-dev -This is the default Tomcat home page. This page serves as a quick reference -guide to related resources and is located at: - - -$TOMCAT_HOME/webapps/ROOT/index.html - - -Included within this release are functional examples with associated source -code, API documentation for servlets and JSP, a README, a technical -FAQ on this release and an assortment of jar files which are -pre-requisites for continued development of web technologies including JSP -and Servlets. - -Examples: - -JSP Examples -Servlet Examples -WebDAV capabilities - - -Documentation: - -API docs for Catalina -(servlet container) -API docs for Jasper -(JSP engine) -API docs for Servlet 2.3 and -JSP 1.2 Packages -General Tomcat User Documentation - - -You can find more information about the JSP and Servlet technologies at: - -http://java.sun.com/products/jsp";>Sun's Java Server Pages Site -http://java.sun.com/products/servlet";>Sun's Servlet Site - - -and by subscribing to one or more of the following Servlet and JSP related -interest lists: - -mailto:[EMAIL PROTECTED]?subject=subscription request: jsp-interest&body=subscribe jsp-interest [Your Full Name]">[EMAIL PROTECTED] -mailto:[EMAIL PROTECTED]?subject=subscription request: servlet-interest&body=subscribe servlet-interest [Your Full Name]">[EMAIL PROTECTED] - - -In addition, Tomcat-specific mailing lists are available at the Jakarta -project web site: - -mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED] for developers working on Tomcat -mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED] for general questions related to configuring and -using Tomcat - - - - - -Copyright © 1999-2000 Apache Software Foundation -All Rights Reserved - - + + + + + + + + + +Web Applications + + + + +JSP Examples +Servlet Examples +WebDAV capabilities + + + + + + + + +Documentation + + + + +Tomcat User Documentation +Tomcat 4.0 API +Jasper (JSP engine) API +Servlet 2.3 and JSP 1.2 API + + + + + + + + +Miscellaneous + + + + +
Re: Tomcat Admin Web Interface
Quoting "Craig R. McClanahan" <[EMAIL PROTECTED]>: > > [...] > > What I'd like to see us do on issues like this is to discuss and agree > on > a functional specs document that is checked in to the CVS repository, > and > then start working together on the pieces. It's a little more formal > than > the usual :-) open source approach, but I think it will help in the > long > run. Does that sound like a useful plan? Sounds good, +1! ..bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets HTMLManagerServlet.java
bip 01/06/05 15:14:38 Modified:catalina/src/share/org/apache/catalina/servlets HTMLManagerServlet.java Log: Defaults to /list if no command is specified. Revision ChangesPath 1.2 +54 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/HTMLManagerServlet.java Index: HTMLManagerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/HTMLManagerServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- HTMLManagerServlet.java 2001/05/27 21:09:11 1.1 +++ HTMLManagerServlet.java 2001/06/05 22:14:35 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/HTMLManagerServlet.java,v 1.1 2001/05/27 21:09:11 bip Exp $ - * $Revision: 1.1 $ - * $Date: 2001/05/27 21:09:11 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/HTMLManagerServlet.java,v 1.2 2001/06/05 22:14:35 bip Exp $ + * $Revision: 1.2 $ + * $Date: 2001/06/05 22:14:35 $ * * * @@ -89,13 +89,63 @@ * same format ar from ManagerServlet * * @author Bip Thelin - * @version $Revision: 1.1 $, $Date: 2001/05/27 21:09:11 $ + * @version $Revision: 1.2 $, $Date: 2001/06/05 22:14:35 $ * @see ManagerServlet */ public final class HTMLManagerServlet extends ManagerServlet { // - Public Methods + +/** + * Process a GET request for the specified resource. + * + * @param request The servlet request we are processing + * @param response The servlet response we are creating + * + * @exception IOException if an input/output error occurs + * @exception ServletException if a servlet-specified error occurs + */ +public void doGet(HttpServletRequest request, + HttpServletResponse response) +throws IOException, ServletException { + +// Identify the request parameters that we need +String command = request.getPathInfo(); + +String path = request.getParameter("path"); +String war = request.getParameter("war"); + +// Prepare our output writer to generate the response message +response.setContentType("text/html"); +PrintWriter writer = response.getWriter(); + +// Process the requested command +if (command == null) { +response.sendRedirect(request.getRequestURI()+"/list"); +} else if (command.equals("/install")) { +install(writer, path, war); +} else if (command.equals("/list")) { +list(writer); +} else if (command.equals("/reload")) { +reload(writer, path); +} else if (command.equals("/remove")) { +remove(writer, path); +} else if (command.equals("/sessions")) { +sessions(writer, path); +} else if (command.equals("/start")) { +start(writer, path); +} else if (command.equals("/stop")) { +stop(writer, path); +} else { +writer.println(sm.getString("managerServlet.unknownCommand", +command)); +} + +// Finish up the response +writer.flush(); +writer.close(); +} /** * Render a HTML list of the currently
Re: [VOTE] New Committer: Mike Anderson
GOMEZ Henri wrote: > > I would like to propose Mike Anderson as a new committer. > > He found many subtils bugs in mod_jk and since he's > working on Netware platforms, it will a great help > to improve connectors on this OS. > > Vote please +1 ..bip
cvs commit: jakarta-tomcat-4.0/catalina build.xml
bip 01/05/31 14:48:31 Modified:catalina build.xml Log: Added digest.sh to the list of files that should be given a execute flag at build time. Revision ChangesPath 1.42 +3 -0 jakarta-tomcat-4.0/catalina/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/build.xml,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- build.xml 2001/05/22 01:59:04 1.41 +++ build.xml 2001/05/31 21:48:29 1.42 @@ -74,6 +74,7 @@ + @@ -274,6 +275,7 @@ + @@ -331,6 +333,7 @@ +
cvs commit: jakarta-tomcat-4.0/webapps/manager/WEB-INF web.xml
bip 01/05/27 14:13:40 Modified:webapps/manager/WEB-INF web.xml Log: Added a comment about HTMLManagerServlet Revision ChangesPath 1.2 +6 -1 jakarta-tomcat-4.0/webapps/manager/WEB-INF/web.xml Index: web.xml === RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/manager/WEB-INF/web.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- web.xml 2000/10/05 02:30:23 1.1 +++ web.xml 2001/05/27 21:13:40 1.2 @@ -6,7 +6,12 @@ - + Manager org.apache.catalina.servlets.ManagerServlet
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets HTMLManagerServlet.java ManagerServlet.java
bip 01/05/27 14:09:11 Modified:catalina/src/share/org/apache/catalina/servlets ManagerServlet.java Added: catalina/src/share/org/apache/catalina/servlets HTMLManagerServlet.java Log: Changed ManagerServlet to allow for subclassing. Added HTMLManagerServlet which is a ManagerServlet with a extended HTML interface to allow for easier administration. Revision ChangesPath 1.6 +130 -128 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java Index: ManagerServlet.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ManagerServlet.java 2001/05/14 00:02:32 1.5 +++ ManagerServlet.java 2001/05/27 21:09:11 1.6 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v 1.5 2001/05/14 00:02:32 craigmcc Exp $ - * $Revision: 1.5 $ - * $Date: 2001/05/14 00:02:32 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v 1.6 2001/05/27 21:09:11 bip Exp $ + * $Revision: 1.6 $ + * $Date: 2001/05/27 21:09:11 $ * * * @@ -152,10 +152,10 @@ * * * @author Craig R. McClanahan - * @version $Revision: 1.5 $ $Date: 2001/05/14 00:02:32 $ + * @version $Revision: 1.6 $ $Date: 2001/05/27 21:09:11 $ */ -public final class ManagerServlet +public class ManagerServlet extends HttpServlet implements ContainerServlet { @@ -165,13 +165,13 @@ /** * The Context container associated with our web application. */ -private Context context = null; +protected Context context = null; /** * The debugging detail level for this servlet. */ -private int debug = 1; +protected int debug = 1; /** @@ -179,20 +179,20 @@ * along with the associated Contexts for web applications that we * are managing. */ -private Deployer deployer = null; +protected Deployer deployer = null; /** * The string manager for this package. */ -private static StringManager sm = - StringManager.getManager(Constants.Package); +protected static StringManager sm = + StringManager.getManager(Constants.Package); /** * The Wrapper container associated with this servlet. */ -private Wrapper wrapper = null; +protected Wrapper wrapper = null; // --- ContainerServlet Methods @@ -250,46 +250,46 @@ * @exception ServletException if a servlet-specified error occurs */ public void doGet(HttpServletRequest request, - HttpServletResponse response) - throws IOException, ServletException { + HttpServletResponse response) +throws IOException, ServletException { - // Identify the request parameters that we need - String command = request.getPathInfo(); - if (command == null) - command = request.getServletPath(); - String path = request.getParameter("path"); - String war = request.getParameter("war"); - - // Prepare our output writer to generate the response message - response.setContentType("text/plain"); - PrintWriter writer = response.getWriter(); - - // Process the requested command - if (command == null) { - writer.println(sm.getString("managerServlet.noCommand")); - } else if (command.equals("/install")) { - install(writer, path, war); - } else if (command.equals("/list")) { - list(writer); - } else if (command.equals("/reload")) { - reload(writer, path); - } else if (command.equals("/remove")) { - remove(writer, path); +// Identify the request parameters that we need +String command = request.getPathInfo(); +if (command == null) +command = request.getServletPath(); +String path = request.getParameter("path"); +String war = request.getParameter("war"); + +// Prepare our output writer to generate the response message +response.setContentType("text/plain"); +PrintWriter writer = response.getWriter(); + +// Process the requested command +if (command == null) { +writer.println(sm.getString("m
Re: JDBC session store, release date projections, etc
> "Dunlop, Aaron" wrote: > > [...] > First: We will need to cluster application servers in front of a central database. > We want the ability to add and remove servers from that farm in real-time, > without disturbing ongoing sessions. That either means storing sessions remotely > in the central DB, or migrating sessions from one machine to another. > We'd like to avoid being forced into using session-affinity for load balancing, > since in our environment, that would likely result in significantly unbalanced >loads. There is some effort going on to provide Clustering ability for TC4, currently you can use it for in memory replication of sessions, however this feature is considered highly experimental. > So that probably means we need JDBC session store. Correct? And if so, what (in your >opinions) > is the current state of JDBC Session Store? (Also - am I correct that it's only >available under > Tomcat 4.0? Will it eventually also be available under the 3.x series?) When it comes to storing sessions you can use either FileStore or JDBCStore, I would say that both are considered "medium rare". ..bip
Re: the ssi mediator
Martin van den Bemt wrote: > > Hi, > > I've been browsing through the util package > (catalaina/src/share/org/apache/catalina/util/* ) for my preperation of > writing tests. I came acros the SsiMediator. All the ssi commands created > there override SsiMediator and SsiMediator adds all the commands to a > hashtable of the commands. > Isn't it wiser to set up a ssicommands.properties with eg : > config=org.apache.blah.blah Yes, I guess that would be a cleaner solution, however you could dispute what you would actually gain from it. The mediator was created because the SsiCommands needed to talk to each other at any given time. i.e. the config command could set a errmsg which would then be used for every SsiCommand on that page. > And make a instance from that class depending on that properties file. > This will make it more flexible and the "compile" dependencies on each ssi > command are gone.. There would still be dependencies, the config command could change how the output would be for different tags and server variables. > Don't if this stuff is actualy used in tomcat 4 (and how to use it), but > just an idea.. It's used in Tomcat4, look in web.xml howto map it to a URL pattern. > We could also do this for the server variables (don't know if this is > subject to change though... > > I'm happy to do the rewrite if I can test this ;-). Remember that there are server variables that could be changed from the config commands. If you have any thoughts, ideas, patches on how to clean up the Ssi code and make it modular I'd be happy to review and commit it. ..bip
cvs commit: jakarta-tomcat-4.0/catalina/docs JDBCRealm-howto.html
bip 01/05/22 13:47:10 Modified:catalina/docs JDBCRealm-howto.html Log: Changed the paragraph on how to digest passwords. Revision ChangesPath 1.4 +7 -2 jakarta-tomcat-4.0/catalina/docs/JDBCRealm-howto.html Index: JDBCRealm-howto.html === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/docs/JDBCRealm-howto.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JDBCRealm-howto.html 2001/01/14 01:31:44 1.3 +++ JDBCRealm-howto.html 2001/05/22 20:47:05 1.4 @@ -222,14 +222,19 @@ Using digested passwords To use digested password you need to store them digested. -To achieve this, you will need to use the same digest strategies that JDBCrealm uses to store the passwords, inside JDBCRealm there is a static method with signature final public static String Digest(String password,String algorithm) this method is provided as a tool to be used outside JDBCRealm by an application that want to store passwords readable by JDBCRealm. +To achieve this, you will need to use the same digest strategies that JDBCrealm uses to store the passwords, either by using: + +The static method inside JDBCRealm. final public static String Digest(String password,String algorithm) +Use the scripts in the bin directory, digest.bat for Windows or digest.sh for unix/linux systems + + Hints - Make sure that the JDBC driver is in the lib directory. - If you have problem connecting you can specify connectionName and connectionPassword -$Header: /home/cvs/jakarta-tomcat-4.0/catalina/docs/JDBCRealm-howto.html,v 1.3 2001/01/14 01:31:44 craigmcc Exp $ +$Header: /home/cvs/jakarta-tomcat-4.0/catalina/docs/JDBCRealm-howto.html,v 1.4 2001/05/22 20:47:05 bip Exp $
cvs commit: jakarta-tomcat-4.0/catalina/src/bin digest.bat digest.sh
bip 01/05/22 13:37:24 Added: catalina/src/bin digest.bat digest.sh Log: scripts to Digest password. Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/bin/digest.bat Index: digest.bat === @echo off rem --- rem digest.bat - Digest password using the algorithm specificied rem rem CATALINA_HOME (Optional) May point at your Catalina "build" directory. rem If not present, the current working directory is assumed. rem rem JAVA_HOME Must point at your Java Development Kit installation. rem rem This script is assumed to run from the bin directory or have the rem CATALINA_HOME env variable set. rem rem $Id: digest.bat,v 1.1 2001/05/22 20:37:19 bip Exp $ rem --- rem - Save Environment Variables That May Change -- set _CATALINA_HOME=%CATALINA_HOME% set _CLASSPATH=%CLASSPATH% set _CP=%CP% rem - Verify and Set Required Environment Variables --- if not "%JAVA_HOME%" == "" goto gotJavaHome echo You must set JAVA_HOME to point at your Java Development Kit installation goto cleanup :gotJavaHome if not "%CATALINA_HOME%" == "" goto gotCatalinaHome set CATALINA_HOME=. if exist "%CATALINA_HOME%\server\lib\catalina.jar" goto okCatalinaHome set CATALINA_HOME=.. :gotCatalinaHome if exist "%CATALINA_HOME%\server\lib\catalina.jar" goto okCatalinaHome echo Cannot find catalina.jar in %CATALINA_HOME%\server\lib echo Please check your CATALINA_HOME setting or run this script from the bin directory goto cleanup :okCatalinaHome rem - Prepare Appropriate Java Execution Commands - set _RUNJAVA="%JAVA_HOME%\bin\java" rem - Set Up The Runtime Classpath set CP=%CATALINA_HOME%\server\lib\catalina.jar set CLASSPATH=%CP% echo Using CLASSPATH: %CLASSPATH% rem - Execute The Requested Command --- if "%1" == "-a" (if "%2" neq "" (if "%3" neq "" goto doRun)) :doUsage echo Usage: digest -a [algorithm] [credentials] echo Commands: echo algorithm - The algorithm to use, i.e. MD5, DES echo credentials - The credential to digest goto cleanup :doRun %_RUNJAVA% org.apache.catalina.realm.JDBCRealm %1 %2 %3 goto cleanup rem - Restore Environment Variables --- :cleanup set CATALINA_HOME=%_CATALINA_HOME% set _CATALINA_HOME= set CLASSPATH=%_CLASSPATH% set _CLASSPATH= set CP=%_CP% set _CP= :finish 1.1 jakarta-tomcat-4.0/catalina/src/bin/digest.sh Index: digest.sh === #!/bin/sh # - # digest.bat - Digest password using the algorithm specificied # # CATALINA_HOME (Optional) May point at your Catalina "build" directory. # If not present, the current working directory is assumed. # # JAVA_HOME Must point at your Java Development Kit installation. # # This script is assumed to run from the bin directory or have the # CATALINA_HOME env variable set. # # $Id: digest.sh,v 1.1 2001/05/22 20:37:21 bip Exp $ # - # - Verify and Set Required Environment Variables - if [ -z "$CATALINA_HOME" ] ; then ## resolve links - $0 may be a link to home PRG=$0 progname=`basename $0` while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '.*/.*' > /dev/null; then PRG="$link" else PRG="`dirname $PRG`/$link" fi done CATALINA_HOME_1=`dirname "$PRG"`/.. echo "Guessing CATALINA_HOME from digest.sh to ${CATALINA_HOME_1}" if [ -d ${CATALINA_HOME_1}/conf ] ; then CATALINA_HOME=${CATALINA_HOME_1} echo "Setting CATALINA_HOME to $CATALINA_HOME" fi fi if [ -z "$JAVA_HOME" ] ; then echo You must set JAVA_HOME to point at your Java Development Kit installation exit 1 fi # - Set Up The System Classpath --- CP="$CATALINA_HOME/server/lib/catalina.jar" if [ -f &q
Re: public static String Digest() in JDBCRealm
"Craig R. McClanahan" wrote: > > It went away by accident during my refactoring. It'll get put back in (by > me) sometime, unless someone wants to beat me to it (hint, hint :-). I put the static method back in along with the main() method. > I'd actually prefer to see a little stand-alone tool for doing this > (available in the bin directory with appropriate scripts), as well as > having the static method restored. I can write up a little tool or script that does this. Maybe just a script that triggers the main method of JDBCRealm? ..bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm JDBCRealm.java
bip 01/05/18 16:39:22 Modified:catalina/src/share/org/apache/catalina/realm JDBCRealm.java Log: Added public final static Digest() and a main method to use when creating digested passwords, this methods where accidently removed when the realm package was refactored. Revision ChangesPath 1.15 +135 -91 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java Index: JDBCRealm.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- JDBCRealm.java2001/04/18 21:43:17 1.14 +++ JDBCRealm.java2001/05/18 23:39:21 1.15 @@ -1,65 +1,66 @@ /* - * The Apache Software License, Version 1.1 - * - * Copyright (c) 1999 The Apache Software Foundation. All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - *notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - *notice, this list of conditions and the following disclaimer in - *the documentation and/or other materials provided with the - *distribution. - * - * 3. The end-user documentation included with the redistribution, if - *any, must include the following acknowlegement: - * "This product includes software developed by the - *Apache Software Foundation (http://www.apache.org/)." - *Alternately, this acknowlegement may appear in the software itself, - *if and wherever such third-party acknowlegements normally appear. - * - * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software - *Foundation" must not be used to endorse or promote products derived - *from this software without prior written permission. For written - *permission, please contact [EMAIL PROTECTED] - * - * 5. Products derived from this software may not be called "Apache" - *nor may "Apache" appear in their names without prior written - *permission of the Apache Group. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - * [Additional notices, if required by prior licensing conditions] - * - */ +* The Apache Software License, Version 1.1 +* +* Copyright (c) 1999 The Apache Software Foundation. All rights +* reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* 1. Redistributions of source code must retain the above copyright +*notice, this list of conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright +*notice, this list of conditions and the following disclaimer in +*the documentation and/or other materials provided with the +*distribution. +* +* 3. The end-user documentation included with the redistribution, if +*any, must include the following acknowlegement: +* "This product includes software developed by the +*Apache Software Foundation (http://www.apache.org/)." +*Alternately, this acknowlegement may appear in the software itself, +*if and wherever such third-party acknowlegements normally appear. +* +* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software +*Foundation" must not be used to endorse or promote
Re: Possibly error in RequestDispatcher
RAUL wrote: > > Hi, > I include a JSP page via RequestDispatcher.include(request, > responseWrapper), being responseWrapper a subclass of > ServletResponseWrapper. This responseWrapper object has its own > ServletOutputStream, the JSP page must write its out to the > responseWrapper's ServletOutputStream. However, it writes its out to the > response provided by the servlet engine. In addiction, if I change > RequestDispatcher.include(request, responseWrapper) for > RequestDispatcher.forward(request, responseWrapper), the JSP page writes > its out to the responseWrapper's ServletOutputStream. Which version of tomcat? I do this for SsiServlet in TC4, check these files: org.apache.catalina.util.ssi.SsiInclude org.apache.catalina.util.ssi.ServletOutputStreamWrapper org.apache.catalina.util.ssi.ResponseIncludeWrapper ..bip
Re: public static String Digest() in JDBCRealm
"Ignacio J. Ortega" wrote: > > Noo, sorry, Craig "cleaned" it, now digest is a normal method not > static.., we are about to add this functionality in other way, like a > standalone tool ) but for now main and static digest is not on beta5 ... Ok thanks, that's what I wanted to know. > I think that was not a bad idea at all, there are users using it so i > dont understand why a used ( useful ) feature can be "cleaned" without > any ... vote ? discussion ?... I'd rather see it in a util class/standalone tool however keeping it as a deprecated method in the meantime woule be nice too. ..bip
Re: public static String Digest() in JDBCRealm
"Ignacio J. Ortega" wrote: > > It 's on RealmBase at least on my CVS working copy.. Sorry, forgot to specify the version, do you have a public Digest method that is static for Tomcat 4 in RealmBase? ..bip
public static String Digest() in JDBCRealm
Have the public static Digest method in JDBCRealm gone away? I couldn't find it when browsing through RealmBase/JDBCRealm. ..bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi package.html
bip 01/05/12 21:06:31 Added: catalina/src/share/org/apache/catalina/util/ssi package.html Log: Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/package.html Index: package.html === This package contains code that is used by the SsiInvoker. This class consists of SsiMediator.java which works as a mediator between the different SsiCommands. To add a command you have to implement the SsiCommand interface and extend the SsiMediator. Commands currently implemented are SsiConfig - Implementation of the NCSA command Config i.e. <!--#config errmsg="error?"--> SsiEcho - Implementation of the NCSA command Echo i.e. <!--#echo var="SERVER_NAME"--> SsiExec - Not implemented SsiFlastMod - Implementation of the NCSA command flastmod i.e. <!--#flastmod virtual="file"--> SsiFsize - Implementation of the NCSA command fsize i.e. <!--#fsize file="file"--> SsiInclude - Implementation of the NCSA command Include i.e. <!--#config virtual="includefile"-->
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster package.html
bip 01/05/12 20:48:14 Added: catalina/src/share/org/apache/catalina/cluster package.html Log: Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/package.html Index: package.html === This package contains code for Clustering, the base class of a Cluster is org.apache.catalina.Cluster implementations of this class is done when implementing a new Cluster protocol The only Cluster protocol currently implemented is a MulticastProtocol StandardCluster.java In addition to the Cluster implementation StandardCluster there's a listener and a sender implemented using multicasting. MulticastSender - A ClusterSender implementation that works with a MulticastSocket MulticastReceiver - A ClusterReceiver implementation that works with a MulticastSocket Both extend the common class ClusterSessionBase which provides common functionality shared by the two implementations.
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session DistributedManager.java
bip 01/05/12 19:27:22 Modified:catalina/src/share/org/apache/catalina Cluster.java catalina/src/share/org/apache/catalina/cluster ClusterMemberInfo.java ClusterSessionBase.java MulticastSender.java StandardCluster.java catalina/src/share/org/apache/catalina/session DistributedManager.java Added: catalina/src/share/org/apache/catalina/cluster Constants.java LocalStrings.properties Log: Minor updates and a bugfix in DistributedManager which caused each replicated session to be replicated again, thus causing a loop. Revision ChangesPath 1.3 +6 -6 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java Index: Cluster.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Cluster.java 2001/05/07 02:15:39 1.2 +++ Cluster.java 2001/05/13 02:27:21 1.3 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java,v 1.2 2001/05/07 02:15:39 bip Exp $ - * $Revision: 1.2 $ - * $Date: 2001/05/07 02:15:39 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java,v 1.3 2001/05/13 02:27:21 bip Exp $ + * $Revision: 1.3 $ + * $Date: 2001/05/13 02:27:21 $ * * * @@ -80,7 +80,7 @@ * ClusterInfo used for receiving information in the Cluster. * * @author Bip Thelin - * @version $Revision: 1.2 $, $Date: 2001/05/07 02:15:39 $ + * @version $Revision: 1.3 $, $Date: 2001/05/13 02:27:21 $ */ public interface Cluster { @@ -164,7 +164,7 @@ * * @return Collection with all members in the Cluster */ -public Collection getRemoteClusterMembers(); +public ClusterMemberInfo[] getRemoteClusterMembers(); /** * Returns a ClusterSender which is the interface @@ -192,5 +192,5 @@ * * @return Cluster information */ -public ClusterMemberInfo getLocalClusterInfo(); +public ClusterMemberInfo getLocalClusterMember(); } 1.2 +43 -6 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/ClusterMemberInfo.java Index: ClusterMemberInfo.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/ClusterMemberInfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ClusterMemberInfo.java2001/05/04 20:48:00 1.1 +++ ClusterMemberInfo.java2001/05/13 02:27:21 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/ClusterMemberInfo.java,v 1.1 2001/05/04 20:48:00 bip Exp $ - * $Revision: 1.1 $ - * $Date: 2001/05/04 20:48:00 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/ClusterMemberInfo.java,v 1.2 2001/05/13 02:27:21 bip Exp $ + * $Revision: 1.2 $ + * $Date: 2001/05/13 02:27:21 $ * * * @@ -63,17 +63,54 @@ package org.apache.catalina.cluster; +import java.io.Serializable; +import org.apache.catalina.Globals; + /** * Class that represents a member in a Cluster, keeps information * that can be used when implementing Classes thats utilizing a Cluster. * * @author Bip Thelin - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ + +public final class ClusterMemberInfo implements Serializable { + +// - Instance Variables -public final class ClusterMemberInfo { +private static String clusterName = null; +private static String hostName = null; + +private static String clusterInfo = null; + // - Properties + +public void setClusterName(String clusterName) { +this.clusterName = clusterName; +} + +public String getClusterName() { +return(this.clusterName); +} + +public void setHostName(String hostName) { +this.hostName = hostName; +} + +public String getHostName() { +return(this.hostName); +} + +public String getServerVersion() { +return(Globals.SERVER_INFO); +} + +public void setClusterInfo(String clusterInfo) { +this.clusterInfo = clusterInfo
cvs commit: jakarta-tomcat-4.0 build.bat
bip 01/05/12 16:49:23 Modified:.build.bat Log: Compile failed when trying to compile the web-inf classes, fails because the relative path to ServletApi was no longer valid. This fix sets a absolute path. Revision ChangesPath 1.20 +3 -3 jakarta-tomcat-4.0/build.bat Index: build.bat === RCS file: /home/cvs/jakarta-tomcat-4.0/build.bat,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- build.bat 2001/05/12 21:40:03 1.19 +++ build.bat 2001/05/12 23:49:23 1.20 @@ -45,7 +45,7 @@ remThe jar filename of the JAXP compliant XML parser remused for jasper [JAXP_PARSER_JAR] rem -rem $Id: build.bat,v 1.19 2001/05/12 21:40:03 bip Exp $ +rem $Id: build.bat,v 1.20 2001/05/12 23:49:23 bip Exp $ rem --- @@ -140,10 +140,10 @@ if not "%SERVLETAPI_HOME%" == "" goto gotServletapiHome if exist "..\jakarta-servletapi-4\dist" ( -set SERVLETAPI_HOME=..\..\jakarta-servletapi-4\dist +set SERVLETAPI_HOME=%CD:~0,-18%jakarta-servletapi-4\dist ) else ( if exist "..\jakarta-servletapi-4\lib" ( -set SERVLETAPI_HOME=..\..\jakarta-servletapi-4 +set SERVLETAPI_HOME=%CD:~0,-18%jakarta-servletapi-4 ) else ( echo You must set SERVLETAPI_HOME to point at your Servlet API install goto cleanup
cvs commit: jakarta-tomcat-4.0 build.bat
bip 01/05/12 14:40:03 Modified:.build.bat Log: Changed the way build check for SERVLETAPI_HOME. If the env variable SERVLETAPI_HOME is not set it looks to see if it can guess the enviroment variable. Revision ChangesPath 1.19 +10 -2 jakarta-tomcat-4.0/build.bat Index: build.bat === RCS file: /home/cvs/jakarta-tomcat-4.0/build.bat,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- build.bat 2001/03/24 01:23:21 1.18 +++ build.bat 2001/05/12 21:40:03 1.19 @@ -45,7 +45,7 @@ remThe jar filename of the JAXP compliant XML parser remused for jasper [JAXP_PARSER_JAR] rem -rem $Id: build.bat,v 1.18 2001/03/24 01:23:21 craigmcc Exp $ +rem $Id: build.bat,v 1.19 2001/05/12 21:40:03 bip Exp $ rem --- @@ -139,7 +139,15 @@ :gotRegexpHome if not "%SERVLETAPI_HOME%" == "" goto gotServletapiHome -set SERVLETAPI_HOME=..\jakarta-servletapi-4\dist +if exist "..\jakarta-servletapi-4\dist" ( +set SERVLETAPI_HOME=..\..\jakarta-servletapi-4\dist +) else ( +if exist "..\jakarta-servletapi-4\lib" ( +set SERVLETAPI_HOME=..\..\jakarta-servletapi-4 +) else ( +echo You must set SERVLETAPI_HOME to point at your Servlet API install +goto cleanup +)) :gotServletapiHome
Re: cvs commit:jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/coreLocalStrings.propertiesStandardContextMapper.java
[EMAIL PROTECTED] wrote: > > craigmcc01/05/11 16:20:12 > > Modified:catalina/src/share/org/apache/catalina/core > LocalStrings.properties StandardContextMapper.java > Log: > Return error 400 if the user uses invalid characters (including %00 and > %7f) in a URI. This fixes a security vulnerability, present in 4.0-b4, > that exposes JSP source code when you request: > > http://localhost:8080/examples/jsp/num/numguess.jsp%00 > > [...] Shouldn't we post a security "hotfix" or cut a new beta release? This seems like a pretty major security flaw. ..bip
Re: Class Loader Problem?
"Wildeboer, Tonnis" wrote: > > [...] > > I have gone so far as completely removing VCALookup.class from my classes > directory and I still get the same Exception. > I also tried instantiating the class from a different file (first line of my > doGet()) and still get the same Exception. > I copied a known good class (my servlet class), renamed it to > VCALookup.class, same Exception. Ok, this is what the Javadocs say about java.lang.ClassFormatError. Thrown when the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file. I interpret this as that the classloader are _finding_ the class but has problems loading it. What is this file/class? Something you copied from somewhere? Could it be that you are missing an inline class for VCALookup? i.e. VCALookup$.class I would think that there's something wrong with the VCALookup class, if it couldn't find the file you wou'd have gotten a ClassNotFoundException. Is VCALookup refering to any other classed that you've missed to bring to your Tomcat env? > 2001-05-01 04:19:15 - Ctx( ): Exception in: R( + /csp + /+cfi/login) - > java.lang.ClassFormatError: VCALookup (Truncated > class file) > at java.lang.ClassLoader.defineClass0(Native Method) > at java.lang.ClassLoader.defineClass0(Compiled Code) > at java.lang.ClassLoader.defineClass(Compiled Code) > at java.security.SecureClassLoader.defineClass(Compiled Code) > at java.net.URLClassLoader.defineClass(Compiled Code) > at java.net.URLClassLoader.access$1(Compiled Code) > at java.net.URLClassLoader$1.run(Compiled Code) > at java.security.AccessController.doPrivileged(Native Method) > at java.security.AccessController.doPrivileged(Compiled Code) > at java.net.URLClassLoader.findClass(Compiled Code) > at java.lang.ClassLoader.loadClass(Compiled Code) > at sun.misc.Launcher$AppClassLoader.loadClass(Compiled Code) > at java.lang.ClassLoader.loadClass(Compiled Code) > at org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(Compiled > Code) > at java.lang.ClassLoader.loadClass(Compiled Code) > at java.lang.ClassLoader.loadClassInternal(Compiled Code) > at MediatorAgent.printTemplateResponse(Compiled Code) > at MediatorAgent.printResponse(MediatorAgent.java:606) > at MainVCAServlet.doGeneral(Compiled Code) > at MainVCAServlet.doGet(MainVCAServlet.java:196) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) > at org.apache.tomcat.core.Handler.service(Handler.java:286) > at > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) > at > org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79 > 7) > at > org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) > at > org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC > onnectionHandler.java:210) > at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code) > at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled > Code) > at java.lang.Thread.run(Compiled Code) Sorry I can't help you more. ..bip
Re: [PROPOSAL/VOTE] Tomcat 4.0 Beta 4 Release
"Craig R. McClanahan" wrote: > > Now that the "Proposed Final Draft 2" versions of the Servlet 2.3 and JSP > 1.2 specs have been published (with Tomcat 4.0 updated to support the > latest changes), and a ton of bug fixes have been made, I would like to > propose that we create a "Tomcat 4.0 Beta 4" release as follows: > > Release Manager: Craig McClanahan > Code Freeze: Thursday, May 10, 2001 at 05:00pm Pacific Time > > See the file "RELEASE-NOTES-4.0-B4.txt" for a reasonably up-to-date list > of the changes to date. This document will be updated with any additional > changes that are made, plus a list of known outstanding issues. > > Between now and the code freeze, I'd like us to focus on fixing > outstanding bugs and catching the configuration documentation up to > date. I'm OK with continuing work on the new distributed session stuff in > the mean time (as long as it is not enabled in the default > configuration), but please hold off on making substantive changes in the > core container until after the Beta 4 release. > > Comments? Votes? > > The usual rules apply: > [ ] +1 = I agree with this proposal and will support it > [ ] +0 = I agree with this proposal, but do not have time to support it > [ ] -0 = I do not agree with this proposal, but don't want to try >to block it > [ ] -1 = I do not agree with this proposal (requires reasons) > > Craig +1 ..bip
Re: [PROPOSAL Tomcat 4.x] Cluster
t identifies the machine, so when you know which machine that "owns" the session all machines that have the session replicated know that it doesn't belong to them so they shouldn't save in a Store. It's also useful for an eventuall tomcat dispatcher frontend to know which machine the session origins from. However some complications occur when you replicate a session and the machine that "owned" the session dies so another machine takes it over. Should that machine then take the role as Machine A1. Cheers, Bip
Re: [PROPOSAL Tomcat 4.x] Cluster
Kief Morris wrote: > > Bip, thanks for kick-starting this discussion, sorry I've taken a while to look > at it. > > [...] If you(or anyone else) wants to play around with the highly experimental Cluster add this right under your in server.xml ..bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session DistributedManager.java
bip 01/05/06 19:15:40 Modified:catalina/src/share/org/apache/catalina Cluster.java catalina/src/share/org/apache/catalina/session DistributedManager.java Log: Cleanup in the Cluster interface to support pluggable Cluster implementations. Changed DistributedManager to support this new change. Revision ChangesPath 1.2 +54 -16 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java Index: Cluster.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Cluster.java 2001/05/04 20:45:35 1.1 +++ Cluster.java 2001/05/07 02:15:39 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java,v 1.1 2001/05/04 20:45:35 bip Exp $ - * $Revision: 1.1 $ - * $Date: 2001/05/04 20:45:35 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java,v 1.2 2001/05/07 02:15:39 bip Exp $ + * $Revision: 1.2 $ + * $Date: 2001/05/07 02:15:39 $ * * * @@ -67,16 +67,20 @@ import java.beans.PropertyChangeListener; import java.util.Collection; import org.apache.catalina.cluster.ClusterMemberInfo; -import org.apache.catalina.cluster.MulticastReceiver; -import org.apache.catalina.cluster.MulticastSender; +import org.apache.catalina.cluster.ClusterReceiver; +import org.apache.catalina.cluster.ClusterSender; /** * A Cluster works as a Cluster client/server for the local host - * Different Cluster implementations can be used to support Session replication - * or weighted loadbalancing. + * Different Cluster implementations can be used to support different + * ways to communicate within the Cluster. A Cluster implementation is + * responsible for setting up a way to communicate within the Cluster + * and also supply "ClientApplications" with ClusterSender + * used when sending information in the Cluster and + * ClusterInfo used for receiving information in the Cluster. * * @author Bip Thelin - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $, $Date: 2001/05/07 02:15:39 $ */ public interface Cluster { @@ -99,6 +103,21 @@ public String getClusterName(); /** + * Set the time in seconds that the Cluster waits before + * checking for changes and replicated data. + * + * @param checkInterval The time in seconds to sleep + */ +public void setCheckInterval(int checkInterval); + +/** + * Get the time in seconds that this Cluster sleeps. + * + * @return The value in seconds + */ +public int getCheckInterval(); + +/** * Set the name of the cluster to join, if no cluster with * this name is present create one. * @@ -120,6 +139,20 @@ */ public Container getContainer(); +/** + * The debug detail level for this Cluster + * + * @param debug The debug level + */ +public void setDebug(int debug); + +/** + * Returns the debug level for this Cluster + * + * @return The debug level + */ +public int getDebug(); + // - Public Methods /** @@ -134,20 +167,25 @@ public Collection getRemoteClusterMembers(); /** - * Returns a MulticastSender which is the interface - * to use when communicating in the Cluster. + * Returns a ClusterSender which is the interface + * to use when sending information in the Cluster. senderId is + * used as a identifier so that information sent through this + * instance can only be used with the respectice + * ClusterReceiver * - * @return The MulticastSender to use + * @return The ClusterSender */ -public MulticastSender getMulticastSender(String senderId); +public ClusterSender getClusterSender(String senderId); /** - * Returns a MulticastReceiver which is the interface - * to use when communicating in the Cluster. + * Returns a ClusterReceiver which is the interface + * to use when receiving information in the Cluster. senderId is + * used as a indentifier, only information send through the + * ClusterSender with the same senderId can be received. * - * @return The MulticastSender to use + * @return The ClusterReceiver */ -public MulticastReceiver getMulticastReceiver(String senderId); +public ClusterReceiver getClusterReceiver(String senderId); /** * Retu
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster ClusterReceiver.java ClusterSender.java ClusterSessionBase.java MulticastReceiver.java MulticastSender.java StandardCluster.java
bip 01/05/06 19:14:10 Modified:catalina/src/share/org/apache/catalina/cluster MulticastReceiver.java MulticastSender.java StandardCluster.java Added: catalina/src/share/org/apache/catalina/cluster ClusterReceiver.java ClusterSender.java ClusterSessionBase.java Log: Made the Cluster package pluggable, StandardCluster is a Standard implementation of a Cluster. It uses MulticastSocket to communicate within the Cluster. If a new Cluster which uses a different protocol are to be added it need to implement org.apache.catalina.Cluster and the sender/receiver classes must implement org.apache.catalina.cluster.[ClusterSender/ClusterReceiver]. Logging and some minor additions have been added. Revision ChangesPath 1.2 +46 -11 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastReceiver.java Index: MulticastReceiver.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastReceiver.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MulticastReceiver.java2001/05/04 20:48:01 1.1 +++ MulticastReceiver.java2001/05/07 02:14:10 1.2 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastReceiver.java,v 1.1 2001/05/04 20:48:01 bip Exp $ - * $Revision: 1.1 $ - * $Date: 2001/05/04 20:48:01 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastReceiver.java,v 1.2 2001/05/07 02:14:10 bip Exp $ + * $Revision: 1.2 $ + * $Date: 2001/05/07 02:14:10 $ * * * @@ -84,14 +84,14 @@ * it onto an internal stack and let it be picked up when needed. * * @author Bip Thelin - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $, $Date: 2001/05/07 02:14:10 $ */ -public class MulticastReceiver implements Runnable { +public final class MulticastReceiver +extends ClusterSessionBase implements ClusterReceiver { // - Instance Variables - /** * The unique message ID */ @@ -108,6 +108,11 @@ private String threadName = "MulticastReceiver"; /** + * The name of our component, used for logging. + */ +private String receiverName = "MulticastReceiver"; + +/** * The stack that keeps incoming requests */ private static Vector stack = new Vector(); @@ -146,8 +151,38 @@ this.senderId = senderId; } +/** + * Return a String containing the name of this + * implementation, used for logging + * + * @return The name of the implementation + */ +public String getName() { +return(this.receiverName); +} + +/** + * Set the time in seconds for this component to + * Sleep before it checks for new received data in the Cluster + * + * @param checkInterval The time to sleep + */ +public void setCheckInterval(int checkInterval) { +this.checkInterval = checkInterval; +} + +/** + * Get the time in seconds this Cluster sleeps + * + * @return The time in seconds this Cluster sleeps + */ +public int getCheckInterval() { +return(this.checkInterval); +} + /** - * Receive the objects currently in our stack + * Receive the objects currently in our stack and clear + * if afterwards. * * @return An array with objects */ @@ -199,11 +234,11 @@ if(obj.getSenderId().equals(this.senderId)) stack.add(obj); } catch (IOException e) { -System.out.println("An error occured when trying to replicate: "+ - e.toString()); +log("An error occured when trying to replicate: "+ +e.toString()); } catch (ClassNotFoundException e) { -System.out.println("An error occured when trying to replicate: "+ - e.toString()); +log("An error occured when trying to replicate: "+ +e.toString()); } } 1.2 +50 -12 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastSender.java Index: MulticastSender.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastSender.java,v retri
Re: [PROPOSAL Tomcat 4.x] Cluster
Kief Morris wrote: > > [...] > > This is one possibility, but if this technique is used, I'm not sure there's > a real need to distribute the sessions at all - the redirector can simply > send the client to the Tomcat instance which holds the session locally. Well that's true if the machine that originally held the sessions is still alive, the beauty of ditributed sessions is that if the machine that spawned the session unexpectadely died any server in the cluster could continue that session. > The problem I have with this approach is the front-end Tomcat becomes > a single point of failure. A big advantage distributing sessions is that any > Tomcat instance is able to handle requests for any client session, even > in the event of failure of other instances. We should also allow Tomcat's > distribution to work if a router-type solution is used to distribute incoming > requests in a non-sticky manner. Well I belive this is the way that the IBM network dispatcher works, and you can cluster it so it would'nt become a singel point of failure. I believe that we need some sort of frontend to the session distribution, I don't think that we should allow a request to go to any server at any time in a cluster. I think that we should as far as possible try to have the session in use hit the machine that spawned it, we can't take for granted that any machine in the cluster have an EXACTLY up to date version of the same session, there's always gonna be some overhead in the replication procedure. > I would make the (controversial, I know) suggestion that the domain > for the cookie be configurable, so that organization foo.com can > set cookies at .foo.com, which would be sent to Tomcat instances > at www1.foo.com, www2.foo.com, etc. This is what a dispatcher/frontend would do, but also keeps a list in memory of where the sessions "belong". > There have been a variety of suggestions for how to implement, including > JavaSpaces, JMS, and JCache. Also JNDI and JDBC and the ugly old file > system (if a networked file system is used) could work. MulticastSocket > is a good idea I hadn't thought of - from looking at your code it's obviously > workable and pretty straightforward. But I think we ought to make the > mechanism pluggable the same way Store is pluggable for PersistentManager. If we change name of the Cluster implementation to MulticastCluster it could be pluggable by anything that implements the org.apache.catalina.Cluster interface. We should also make a Interface to send and receive data that the MulticastReceiver/Sender would implement. I'll start work on that immediately. > We also need to answer the question of the request life cycle: the > DistributedManager needs to know when a request begins and ends. > At the beginning, it must lock the session to prevent other Catalina > instances from using it in requests. This can probably just be done > in Manager.findSession(). At the end, it must tell the ClusterStore to > update the session to other members of the Cluster, and unlock it. I'm not really sure what you're saying here. As I envisioned it a DistributedManager is responsible for replicating sessions and to restore replicated sessions. A Store is a pluggable component that are the same for any Manager implementation(that makes use of a Store). If we say that only one JVM at a time can manipulate a sessions since a sessions only belongs to one machine at a time the only time a session needs to be replicated is when it's created/changed/destroyed. > A MulticastStoreCluster (or whatever) should be pretty straightforward > to do with Bip's code. Some comments (intended as a "to think about/do", > rather than as a criticism of Bip's code, which is meant as a starting point > for discussion) I'd rather see the replication be implemented in a Manager(i.e. DistributedManager or maybe change name to MulticastDistributedManager) thus making it possible to run any Store with the DistributedManager(i.e. FileStore). Thanks for the comments Kief! Regards, Bip
Re: [PROPOSAL/VOTE] New Repositories for Collaborative Development
[EMAIL PROTECTED] wrote: > > On Fri, 4 May 2001, Craig R. McClanahan wrote: > > > > [...] > > > > I've said it before, and i'll say it again -- 3.2 is in maintenance mode, > > and doesn't need any further focus for enhancements. Time spent providing > > enhancements there would be better spent focusing on its replacement. > > Even if you mean 3.3, I don't agree :-) > > The container itself is mostly done ( 3.2 and 3.3 ), but you need more > than a container for a production system. I guess more or less the only reason why TC4 hasn't been released as final is because the Servlet/Jsp spec's aren't final so when those get final I'll guess that we'll start working towards a "real" TC4 release. That release would then be the current Tomcat release and thus making TC < 4 more or less obsolete. Sure, user's won't be switching over immediately but I guess what Craig is saying is that TC3.x should only live in maintenance mode until a stable version of TC4 is released and thus making enhancements to the TC3.x branches a waste of time. > Tomcat itself is just a small part of a solution. You also need to > integrate it and to add what is needed for a "real world" use. Yes, but should we really focus on adding stuff/enhancements to the TC3.x branches? ..bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster ClusterMemberInfo.java MulticastReceiver.java MulticastSender.java ReplicationWrapper.java StandardCluster.java
bip 01/05/04 13:48:04 Added: catalina/src/share/org/apache/catalina/cluster ClusterMemberInfo.java MulticastReceiver.java MulticastSender.java ReplicationWrapper.java StandardCluster.java Log: Basic Cluster implementation Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/ClusterMemberInfo.java Index: ClusterMemberInfo.java === /* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/ClusterMemberInfo.java,v 1.1 2001/05/04 20:48:00 bip Exp $ * $Revision: 1.1 $ * $Date: 2001/05/04 20:48:00 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.cluster; /** * Class that represents a member in a Cluster, keeps information * that can be used when implementing Classes thats utilizing a Cluster. * * @author Bip Thelin * @version $Revision: 1.1 $ */ public final class ClusterMemberInfo { // - Properties // - Public Methods } 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastReceiver.java Index: MulticastReceiver.java === /* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster/MulticastReceiver.java,v 1.1 2001/05/04 20:48:01 bip Exp $ * $Revision: 1.1 $ * $Date: 2001/05/04 20:48:01 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster - New directory
bip 01/05/04 13:46:16 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/cluster - New directory
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Catalina.java
bip 01/05/04 13:45:58 Modified:catalina/src/share/org/apache/catalina Container.java catalina/src/share/org/apache/catalina/core ContainerBase.java catalina/src/share/org/apache/catalina/session PersistentManager.java PersistentManagerBase.java catalina/src/share/org/apache/catalina/startup Catalina.java Added: catalina/src/share/org/apache/catalina Cluster.java catalina/src/share/org/apache/catalina/session DistributedManager.java Log: Added a basic ClusterManger used from within DistributedManager Revision ChangesPath 1.4 +20 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java Index: Container.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Container.java2001/01/23 05:05:44 1.3 +++ Container.java2001/05/04 20:45:36 1.4 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java,v 1.3 2001/01/23 05:05:44 remm Exp $ - * $Revision: 1.3 $ - * $Date: 2001/01/23 05:05:44 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Container.java,v 1.4 2001/05/04 20:45:36 bip Exp $ + * $Revision: 1.4 $ + * $Date: 2001/05/04 20:45:36 $ * * * @@ -120,7 +120,7 @@ * * @author Craig R. McClanahan * @author Remy Maucherat - * @version $Revision: 1.3 $ $Date: 2001/01/23 05:05:44 $ + * @version $Revision: 1.4 $ $Date: 2001/05/04 20:45:36 $ */ public interface Container { @@ -228,6 +228,22 @@ * @param manager The newly associated Manager */ public void setManager(Manager manager); + + +/** + * Return the Cluster with which this Container is associated. If there is + * no associated Cluster, return the Cluster associated with our parent + * Container (if any); otherwise return null. + */ +public Cluster getCluster(); + + +/** + * Set the Cluster with which this Container is associated. + * + * @param connector The Connector to be added + */ +public void setCluster(Cluster cluster); /** 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java Index: Cluster.java === /* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/Cluster.java,v 1.1 2001/05/04 20:45:35 bip Exp $ * $Revision: 1.1 $ * $Date: 2001/05/04 20:45:35 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY D
Re: [VOTE] New Committer: Kevin Seguin
GOMEZ Henri wrote: > > I would like to propose Kevin Seguin as a new committer. > > He make a great job in developping the ajp13 protocol > for Tomcat 4.0 and this code will be a great help for > sites wanting to upgrade from 3.2.x to 4.0 while still > using mod_jk +1 Welcome! ..bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session StandardManager.java
bip 01/05/03 13:45:05 Modified:catalina/src/share/org/apache/catalina/session StandardManager.java Log: Changed StandardManager to use the org.apache.util.CustomObjectInputStream instead of the inline CustomObjectInputStream. Revision ChangesPath 1.10 +5 -62 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java Index: StandardManager.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- StandardManager.java 2001/04/17 17:07:04 1.9 +++ StandardManager.java 2001/05/03 20:45:03 1.10 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java,v 1.9 2001/04/17 17:07:04 craigmcc Exp $ - * $Revision: 1.9 $ - * $Date: 2001/04/17 17:07:04 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardManager.java,v 1.10 2001/05/03 20:45:03 bip Exp $ + * $Revision: 1.10 $ + * $Date: 2001/05/03 20:45:03 $ * * * @@ -91,6 +91,7 @@ import org.apache.catalina.Loader; import org.apache.catalina.Manager; import org.apache.catalina.Session; +import org.apache.catalina.util.CustomObjectInputStream; import org.apache.catalina.util.LifecycleSupport; @@ -105,7 +106,7 @@ * stop() methods of this class at the correct times. * * @author Craig R. McClanahan - * @version $Revision: 1.9 $ $Date: 2001/04/17 17:07:04 $ + * @version $Revision: 1.10 $ $Date: 2001/05/03 20:45:03 $ */ public class StandardManager @@ -815,62 +816,4 @@ } } - - -// Private Classes - - -/** - * Custom subclass of ObjectInputStream that loads from the - * class loader for this web application. This allows classes defined only - * with the web application to be found correctly. - */ -private static final class CustomObjectInputStream -extends ObjectInputStream { - - -/** - * The class loader we will use to resolve classes. - */ -private ClassLoader classLoader = null; - - -/** - * Construct a new instance of CustomObjectInputStream - * - * @param stream The input stream we will read from - * @param classLoader The class loader used to instantiate objects - * - * @exception IOException if an input/output error occurs - */ -public CustomObjectInputStream(InputStream stream, - ClassLoader classLoader) -throws IOException { - -super(stream); -this.classLoader = classLoader; - -} - - -/** - * Load the local class equivalent of the specified stream class - * description, by using the class loader assigned to this Context. - * - * @param classDesc Class description from the input stream - * - * @exception ClassNotFoundException if this class cannot be found - * @exception IOException if an input/output error occurs - */ -protected Class resolveClass(ObjectStreamClass classDesc) -throws ClassNotFoundException, IOException { - -return (classLoader.loadClass(classDesc.getName())); - -} - - -} - - }
[PROPOSAL Tomcat 4.x] Cluster
I started looking at how to implement a DistributedManager and as I see it the best way to do this is to use MulticastSocket. So I started to look at how to implement it using MulticastSocket and started thinking about including that in a Cluster package. So you configure a package from within Server.xml The Cluster package joins a Cluster group(Multicast group) and have a defined set of methods/interfaces to communicate with each other. These clusters could then be used to implement in memory session replication, aka. Distributed sessions. What we would gain from this in the future is that we can hook in different things that uses the Cluster, for doing weighted load balancing and other stuff. I started writing some initial stubs and interfaces on how this could work, I don't just want to commit it without having ventilated it here first. Maybe this is a shitty idea to begin with. ..bip
cvs commit: jakarta-tomcat-4.0/catalina/docs JDBCStore-howto.html
bip 01/04/27 15:11:04 Added: catalina/docs JDBCStore-howto.html Log: Howto file explaining the use of Session persistence with JDBCStore Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/docs/JDBCStore-howto.html Index: JDBCStore-howto.html === td { background-color: #E0E0E0; vertical-align: text-top; } th { background-color: #d0d0d0; } table { width: 75%; background-color: #00; } Using JDBCStore for Session persistence Home Using JDBCStore for Session persistence What is JDBCStore? Is an implementation of a tomcat 4.X Store that use a table to store sessions. When to store sessions is configured in the Manager, currently the only Manager supported is the PersistentManager. Please consult the Manager manual for configuring the PersistentManager. All the parameters, drivers, tables, and columns are user configurable. Example Config for JDBCStore This is an example of how to set up a JDBCStore. For this example I used the MySQL JDBC driver. 1. Create a database. I made the database named "tomcat" 2. Create the needed table. 1. The session table. This table holds the sessions currently stored due to backup/swapout/maxidle or other criteria met. create database tomcat; create table tomcat$sessions ( id varchar(100) not null primary key, valid char(1) not null, maxinactive int not null, lastaccess bigint, data mediumblob ); Here is sample output from the tables: mysql> create database tomcat; Query OK, 1 row affected (0.02 sec) mysql> use tomcat; Database changed mysql> create table tomcat$sessions -> ( -> id varchar(100) not null primary key, -> valid char(1) not null, -> maxinactive int not null, -> lastaccess bigint, -> data mediumblob); Query OK, 0 rows affected (0.01 sec) 3. Configure Tomcat Add the information to the server.xml file. Make sure that you configure the Store inside a Manger. PersistentManager is the only one supported as of writing. For this example I used this entry inside: <Manager className="org.apache.catalina.session.PersistentManager" debug="0" saveOnRestart="true" maxActiveSessions="-1" minIdleSwap="-1" maxIdleSwap="-1" maxIdleBackup="-1"> <Store className="org.apache.catalina.session.JDBCStore" driverName="org.gjt.mm.mysql.Driver" connectionURL="jdbc:mysql://localhost/tomcat?user=test&password=test" sessionTable="tomcat$sessions" sessionIdCol="id" sessionDataCol="data" sessionValidCol="valid" sessionMaxInactiveCol="maxinactive" sessionLastAccessedCol="lastaccess" checkInterval="60" debug="99" /> <Manager> The meaning of the attributes is as follow: attribute Meaning className The class to use as a Store, If you want to use a different Store than JDBCStore you're reading the wrong file driverName The name of the driver needed to connect to the database connectionURL The connection URL used to connect to the database sessionTable The table in which we store our sessions sessionIdCol The column in the session table that contains the session ID sessionDataCol The column in the session table that contains the session data sessionValidCol The column in the session table that holds if the session is valid or not. sessionMaxInactiveCol The column in the session table that contains the sessions Max Inactive property sessionLastAccessedCol The column in the session table that contains the last accesed time checkInterval The time in seconds for the processExpires thread to sleep, a lower value causes more accurate expiring and removing old sessions from the RDBMS but could cause a heavily loaded site to go on it's knees if set to low. debug The debug level for this Store, 0 means don't log any debug information and that's probably what you would want for a production enviroment. $Header: /home/cvs/jakarta-tomcat-4.0/catalina/docs/JDBCStore-howto.html,v 1.1 2001/04/27 22:11:03 bip Exp $
cvs commit: jakarta-tomcat-4.0/catalina/docs index.html
bip 01/04/27 15:09:58 Modified:catalina/docs index.html Log: Added JDBCStore-howto entry Revision ChangesPath 1.6 +1 -0 jakarta-tomcat-4.0/catalina/docs/index.html Index: index.html === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/docs/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- index.html2001/02/14 22:26:32 1.5 +++ index.html2001/04/27 22:09:57 1.6 @@ -16,6 +16,7 @@ Server Configuration JDBCRealm Configuration +Session persistence with JDBCStore Single Sign On Support Tomcat Manager Application
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi ResponseIncludeWrapper.java ServletOutputStreamWrapper.java SsiCommand.java SsiConfig.java SsiEcho.java SsiFlastmod.java SsiFsize.java SsiInclude.java SsiMediator.java
bip 01/04/26 15:58:50 Modified:catalina/src/share/org/apache/catalina/util/ssi ResponseIncludeWrapper.java ServletOutputStreamWrapper.java SsiCommand.java SsiConfig.java SsiEcho.java SsiFlastmod.java SsiFsize.java SsiInclude.java SsiMediator.java Log: Minor modifications and more Javadoc comments Revision ChangesPath 1.2 +54 -23 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/ResponseIncludeWrapper.java Index: ResponseIncludeWrapper.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/ResponseIncludeWrapper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ResponseIncludeWrapper.java 2001/03/27 20:38:00 1.1 +++ ResponseIncludeWrapper.java 2001/04/26 22:58:49 1.2 @@ -1,8 +1,8 @@ /* * ResponseIncludeWrapper.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/ResponseIncludeWrapper.java,v 1.1 2001/03/27 20:38:00 amyroh Exp $ - * $Revision: 1.1 $ - * $Date: 2001/03/27 20:38:00 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/ResponseIncludeWrapper.java,v 1.2 2001/04/26 22:58:49 bip Exp $ + * $Revision: 1.2 $ + * $Date: 2001/04/26 22:58:49 $ * * * @@ -71,42 +71,73 @@ import javax.servlet.http.HttpServletResponseWrapper; /** - * @author Bip Thelin - * @version $Revision: 1.1 $, $Date: 2001/03/27 20:38:00 $ + * A HttpServletResponseWrapper, used from SsiInclude * + * @author Bip Thelin + * @version $Revision: 1.2 $, $Date: 2001/04/26 22:58:49 $ */ public final class ResponseIncludeWrapper extends HttpServletResponseWrapper { +/** + * Our ServletOutputStream + */ private ServletOutputStream _out; +/** + * Variable to determine if we're using printwriter + */ private boolean printwriter = false; +/** + * Variable to determine if we're using outputstream + */ private boolean outputstream = false; +/** + * Initialize our wrapper with the current HttpServletResponse + * and ServletOutputStream. + * + * @param res The HttpServletResponse to use + * @param out The ServletOutputStream' to use + */ public ResponseIncludeWrapper(HttpServletResponse res, - ServletOutputStream out) { - super(res); - this._out = out; + ServletOutputStream out) { +super(res); +this._out = out; } - + +/** + * Return a printwriter, throws and exception if a + * OutputStream already been returned. + * + * @return a PrintWriter object + * @exception java.io.IOException if the outputstream already been called + */ public PrintWriter getWriter() - throws java.io.IOException { - if(!outputstream) { - printwriter=true; - return (new PrintWriter(_out)); - } else { - throw new IllegalStateException(); - } +throws java.io.IOException { +if(!outputstream) { +printwriter=true; +return (new PrintWriter(_out)); +} else { +throw new IllegalStateException(); +} } +/** + * Return a OutputStream, throws and exception if a + * printwriter already been returned. + * + * @return a OutputStream object + * @exception java.io.IOException if the printwriter already been called + */ public ServletOutputStream getOutputStream() - throws java.io.IOException { - if(!printwriter) { - outputstream=true; - return _out; - } else { - throw new IllegalStateException(); - } +throws java.io.IOException { +if(!printwriter) { +outputstream=true; +return _out; +} else { +throw new IllegalStateException(); +} } } 1.2 +30 -9 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/ServletOutputStreamWrapper.java Index: ServletOutputStreamWrapper.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/ServletOutputStreamWrapper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ServletOutputStreamWrapper.java 2001/03/27 20:38:00 1.1 +++ ServletOutputStreamWrapper.java 2001/04/26 22:58:49 1.2
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session JDBCStore.java
bip 01/04/26 13:17:21 Modified:catalina/src/share/org/apache/catalina/session JDBCStore.java Log: Changed the SQL Statement for keys(), threw an error under MySQL. Revision ChangesPath 1.3 +26 -23 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java Index: JDBCStore.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JDBCStore.java2001/04/26 03:14:59 1.2 +++ JDBCStore.java2001/04/26 20:17:15 1.3 @@ -1,8 +1,8 @@ /* * JDBCStore.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java,v 1.2 2001/04/26 03:14:59 bip Exp $ - * $Revision: 1.2 $ - * $Date: 2001/04/26 03:14:59 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java,v 1.3 2001/04/26 20:17:15 bip Exp $ + * $Revision: 1.3 $ + * $Date: 2001/04/26 20:17:15 $ * * * @@ -93,7 +93,7 @@ * saved are still subject to being expired based on inactivity. * * @author Bip Thelin - * @version $Revision: 1.2 $, $Date: 2001/04/26 03:14:59 $ + * @version $Revision: 1.3 $, $Date: 2001/04/26 20:17:15 $ */ public class JDBCStore @@ -388,10 +388,10 @@ */ public String[] keys() throws IOException { String keysSql = -"SELECT c.size, s."+sessionIdCol+ -" FROM "+sessionTable+" s, "+ -"(SELECT COUNT("+sessionIdCol+ -") AS size FROM "+sessionTable+") c"; +"SELECT COUNT(s."+sessionIdCol+"), s."+sessionIdCol+ +" FROM "+sessionTable+" s, "+sessionTable+" c"+ +" GROUP BY c."+sessionIdCol; + Connection _conn = getConnection(); ResultSet rst = null; String keys[] = null; @@ -535,25 +535,28 @@ release(_conn); _conn = null; } - -try { -_session = (StandardSession) manager.createSession(); -_session.readObjectData(ois); -_session.setManager(manager); -} finally { -if (ois != null) { -try { -ois.close(); -bis = null; -} catch (IOException e) { -; + +if(ois != null) { +try { +_session = (StandardSession) manager.createSession(); +_session.readObjectData(ois); +_session.setManager(manager); +} finally { +if (ois != null) { +try { +ois.close(); +bis = null; +} catch (IOException e) { +; +} } } + +if (debug > 0) +log(sm.getString(getStoreName()+".loading", + id, sessionTable)); } -if (debug > 0) -log(sm.getString(getStoreName()+".loading", - id, sessionTable)); return(_session); }
Re: Tomcat Source Javadoc
Sasha Haghani wrote: > > Is there any Javadoc for the Tomact source? Can I generate it myself? Javadoc is generated once you do a build, look in jakarta-tomcat-4.0/build/webapps/ROOT/(catalina-javadoc||jasper-javadoc||servletapi-javadoc) ..bip
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session JDBCStore.java StoreBase.java
bip 01/04/25 20:15:01 Modified:catalina/src/share/org/apache/catalina/session JDBCStore.java StoreBase.java Log: Changed subclassing of start()/stop(). Cosmetic changes, tabs to spaces. Revision ChangesPath 1.2 +383 -378 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java Index: JDBCStore.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JDBCStore.java2001/04/26 01:37:59 1.1 +++ JDBCStore.java2001/04/26 03:14:59 1.2 @@ -1,8 +1,8 @@ /* * JDBCStore.java - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java,v 1.1 2001/04/26 01:37:59 bip Exp $ - * $Revision: 1.1 $ - * $Date: 2001/04/26 01:37:59 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java,v 1.2 2001/04/26 03:14:59 bip Exp $ + * $Revision: 1.2 $ + * $Date: 2001/04/26 03:14:59 $ * * * @@ -81,6 +81,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import org.apache.catalina.Container; +import org.apache.catalina.LifecycleException; import org.apache.catalina.Loader; import org.apache.catalina.Session; import org.apache.catalina.Store; @@ -92,7 +93,7 @@ * saved are still subject to being expired based on inactivity. * * @author Bip Thelin - * @version $Revision: 1.1 $, $Date: 2001/04/26 01:37:59 $ + * @version $Revision: 1.2 $, $Date: 2001/04/26 03:14:59 $ */ public class JDBCStore @@ -198,21 +199,21 @@ * Return the info for this Store. */ public String getInfo() { - return(info); +return(info); } /** * Return the thread name for this Store. */ public String getThreadName() { - return(threadName); +return(threadName); } /** * Return the name for this Store, used for logging. */ public String getStoreName() { - return(storeName); +return(storeName); } /** @@ -221,19 +222,19 @@ * @param driverName The new driver */ public void setDriverName(String driverName) { - String oldDriverName = this.driverName; - this.driverName = driverName; - support.firePropertyChange("driverName", -oldDriverName, -this.driverName); - this.driverName = driverName; +String oldDriverName = this.driverName; +this.driverName = driverName; +support.firePropertyChange("driverName", + oldDriverName, + this.driverName); +this.driverName = driverName; } /** * Return the driver for this Store. */ public String getDriverName() { - return(this.driverName); +return(this.driverName); } /** @@ -242,18 +243,18 @@ * @param connectionURL The new Connection URL */ public void setConnectionURL(String connectionURL) { - String oldConnString = this.connString; - this.connString = connectionURL; - support.firePropertyChange("connString", -oldConnString, -this.connString); +String oldConnString = this.connString; +this.connString = connectionURL; +support.firePropertyChange("connString", + oldConnString, + this.connString); } /** * Return the Connection URL for this Store. */ public String getConnectionURL() { - return(this.connString); +return(this.connString); } /** @@ -262,18 +263,18 @@ * @param sessionTable The new table */ public void setSessionTable(String sessionTable) { - String oldSessionTable = this.sessionTable; - this.sessionTable = sessionTable; - support.firePropertyChange("sessionTable", -oldSessionTable, -this.sessionTable); +String oldSessionTable = this.sessionTable; +this.sessionTable = sessionTable; +support.firePropertyChange("sessionTable", + oldSessionTable, + this.sessionTable); } /** * Return the table for this Store. */ public
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util CustomObjectInputstream.java
bip 01/04/25 18:48:38 Removed: catalina/src/share/org/apache/catalina/util CustomObjectInputstream.java Log: Name mismatch, recommiting.
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session LocalStrings.properties
bip 01/04/25 18:41:00 Modified:catalina/src/share/org/apache/catalina/session LocalStrings.properties Log: Added entries for JDBCStore. Revision ChangesPath 1.7 +10 -0 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/LocalStrings.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- LocalStrings.properties 2001/04/15 10:50:04 1.6 +++ LocalStrings.properties 2001/04/26 01:40:55 1.7 @@ -5,6 +5,16 @@ fileStore.saving=Saving Session {0} to file {1} fileStore.loading=Loading Session {0} from file {1} fileStore.removing=Removing Session {0} at file {1} +JDBCStore.alreadyStarted=JDBC Store has already been started +JDBCStore.notStarted=JDBC Store has not yet been started +JDBCStore.saving=Saving Session {0} to database {1} +JDBCStore.loading=Loading Session {0} from database {1} +JDBCStore.removing=Removing Session {0} at database {1} +JDBCStore.SQLException=SQL Error {0} +JDBCStore.checkConnectionDBClosed=The database connection is null or was found to be closed. Trying to re-open it. +JDBCStore.checkConnectionDBReOpenFail=The re-open on the database failed. The database could be down. +JDBCStore.checkConnectionSQLException=A SQL exception occured {0} +JDBCStore.checkConnectionClassNotFoundException=JDBC driver class not found {0} managerBase.complete=Seeding of random number generator has been completed managerBase.getting=Getting message digest component for algorithm {0} managerBase.gotten=Completed getting message digest component
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session FileStore.java
bip 01/04/25 18:40:17 Modified:catalina/src/share/org/apache/catalina/session FileStore.java Log: Refactored to take advantage of StoreBase. Updated to use CustomObjectInputstream() from util instead of having it as a inline class. Revision ChangesPath 1.5 +30 -189 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/FileStore.java Index: FileStore.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/FileStore.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- FileStore.java2001/04/14 10:56:29 1.4 +++ FileStore.java2001/04/26 01:40:10 1.5 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/FileStore.java,v 1.4 2001/04/14 10:56:29 kief Exp $ - * $Revision: 1.4 $ - * $Date: 2001/04/14 10:56:29 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/FileStore.java,v 1.5 2001/04/26 01:40:10 bip Exp $ + * $Revision: 1.5 $ + * $Date: 2001/04/26 01:40:10 $ * * * @@ -65,8 +65,6 @@ package org.apache.catalina.session; -import java.beans.PropertyChangeListener; -import java.beans.PropertyChangeSupport; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; @@ -85,18 +83,11 @@ import javax.servlet.ServletContext; import org.apache.catalina.Context; import org.apache.catalina.Globals; -import org.apache.catalina.Lifecycle; -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleException; -import org.apache.catalina.LifecycleListener; import org.apache.catalina.Loader; -import org.apache.catalina.Logger; -import org.apache.catalina.Manager; import org.apache.catalina.Session; import org.apache.catalina.Store; import org.apache.catalina.Container; -import org.apache.catalina.util.LifecycleSupport; -import org.apache.catalina.util.StringManager; +import org.apache.catalina.util.CustomObjectInputStream; /** @@ -105,11 +96,11 @@ * saved are still subject to being expired based on inactivity. * * @author Craig R. McClanahan - * @version $Revision: 1.4 $ $Date: 2001/04/14 10:56:29 $ + * @version $Revision: 1.5 $ $Date: 2001/04/26 01:40:10 $ */ public final class FileStore -implements Store { +extends StoreBase implements Store { // - Constants @@ -142,30 +133,15 @@ */ private static final String info = "FileStore/1.0"; - -/** - * The string manager for this package. - */ -private StringManager sm = -StringManager.getManager(Constants.Package); - - -/** - * The property change support for this component. - */ -private PropertyChangeSupport support = new PropertyChangeSupport(this); - - /** - * The Manager with which this FileStore is associated. + * Name to register for this Store, used for logging. */ -protected Manager manager; +private static final String storeName = "fileStore"; - /** - * The debugging detail level for this component. + * Name to register for the background thread. */ -protected int debug = 0; +private static final String threadName = "FileStore"; // - Properties @@ -208,6 +184,20 @@ } +/** + * Return the thread name for this Store. + */ +public String getThreadName() { + return(threadName); +} + +/** + * Return the name for this Store, used for logging. + */ +public String getStoreName() { + return(storeName); +} + /** * Return the number of Sessions present in this Store. @@ -230,67 +220,8 @@ } -/** - * Return the Manager with which the FileStore is associated. - */ -public Manager getManager() { - -return (this.manager); - -} - - -/** - * Set the Manager with which this FileStore is associated. - * - * @param manager The newly associated Manager - */ -public void setManager(Manager manager) { - -Manager oldManager = this.manager; -this.manager = manager; -support.firePropertyChange("manager", oldManager, this.manager); - -} - - -/** - * Return the debugging detail level for this component. - */ -public int getDeb
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session JDBCStore.java
bip 01/04/25 18:38:01 Added: catalina/src/share/org/apache/catalina/session JDBCStore.java Log: A concrete Store implementation that uses a JDBC compatible RDBMS to store Sessions. Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java Index: JDBCStore.java === /* * JDBCStore.java * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/JDBCStore.java,v 1.1 2001/04/26 01:37:59 bip Exp $ * $Revision: 1.1 $ * $Date: 2001/04/26 01:37:59 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.session; import java.io.InputStream; import java.io.OutputStream; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamClass; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import org.apache.catalina.Container; import org.apache.catalina.Loader; import org.apache.catalina.Session; import org.apache.catalina.Store; import org.apache.catalina.util.CustomObjectInputStream; /** * Implementation of the Store interface that stores * serialized session objects in a database. Sessions that are * saved are still subject to being expired based on inactivity. * * @author Bip Thelin * @version $Revision: 1.1 $, $Date: 2001/04/26 01:37:59 $ */ public class JDBCStore extends StoreBase implements Store { /** * The descriptive information about this implementation. */ protected static String info = "JDBCStore/1.0"; /** * Name to register for this Store, used for logging. *
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session StoreBase.java
bip 01/04/25 18:36:06 Added: catalina/src/share/org/apache/catalina/session StoreBase.java Log: Moved common code from FileStore/JDBCStore into StoreBase. Extended by the concrete Store implementations like FileStore. Each Store now have the ability to implement their own processExpires() and storeStart()/storeStop(). Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StoreBase.java Index: StoreBase.java === /* * StoreBase.java * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StoreBase.java,v 1.1 2001/04/26 01:36:05 bip Exp $ * $Revision: 1.1 $ * $Date: 2001/04/26 01:36:05 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.session; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.IOException; import org.apache.catalina.Container; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleListener; import org.apache.catalina.Logger; import org.apache.catalina.Manager; import org.apache.catalina.Store; import org.apache.catalina.util.LifecycleSupport; import org.apache.catalina.util.StringManager; /** * Abstract implementation of the Store interface to * support most of the functionality required by a Store. * * @author Bip Thelin * @version $Revision: 1.1 $, $Date: 2001/04/26 01:36:05 $ */ public abstract class StoreBase implements Lifecycle, Runnable, Store { // - Instance Variables /** * The descriptive information about this implementation. */ protected static String info = "StoreBase/1.0"; /** * The interval (in seconds)
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util CustomObjectInputstream.java
bip 01/04/25 18:30:27 Added: catalina/src/share/org/apache/catalina/util CustomObjectInputstream.java Log: Initial revision, broken out from FileStore. Revision ChangesPath 1.1 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CustomObjectInputstream.java Index: CustomObjectInputstream.java === /* * CustomObjectInputStream.java * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CustomObjectInputstream.java,v 1.1 2001/04/26 01:30:27 bip Exp $ * $Revision: 1.1 $ * $Date: 2001/04/26 01:30:27 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.util; import java.io.InputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectStreamClass; /** * Custom subclass of ObjectInputStream that loads from the * class loader for this web application. This allows classes defined only * with the web application to be found correctly. * * @author Craig R. McClanahan * @author Bip Thelin * @version $Revision: 1.1 $, $Date: 2001/04/26 01:30:27 $ */ public final class CustomObjectInputStream extends ObjectInputStream { /** * The class loader we will use to resolve classes. */ private ClassLoader classLoader = null; /** * Construct a new instance of CustomObjectInputStream * * @param stream The input stream we will read from * @param classLoader The class loader used to instantiate objects * * @exception IOException if an input/output error occurs */ public CustomObjectInputStream(InputStream stream, ClassLoader classLoader) throws IOException { super(stream); this.classLoader = classLoader; } /** * Load the local class equivalent of the specified stream class * description, by using the class loader assigne
Re: Store Proposal
Kief Morris wrote: > > [...] > > Great - can you provide these patches as file attachments? They came in the > body of your message, which is very difficult to reliably apply to the sources. Attached is the files, the CustomObjectInputstream goes in the util dir. ..bip StoreFiles.zip
Store Proposal
We've had some issues with the background threads, expiration and stuff so I migrated some of the common stuff into a StoreBase and had JDBCStore and FileStore extend it and have the opportunity to implement it's own processexpires and some other methods. The code is attatched. I've also implemented an extended table for JDBCStore, there still remains some work on using the extended fields when checking expiration and loading I'll have that done soon. This is what a table for JDBCStore now should look like: TABLE [tomcat$sessions] ( [id] [varchar] (100) NOT NULL , [data] [varbinary] (1000) NULL , [valid] [char] (1) NOT NULL , [maxinactive] [int] NOT NULL , [lastaccess] [numeric](18, 0) NULL ) Here's how you can configure the table and column names: ..bip /* * StoreBase.java * $Header$ * $Revision$ * $Date$ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.session; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.IOException; import org.apache.catalina.Container; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleListener; import org.apache.catalina.Logger; import org.apache.catalina.Manager; import org.apache.catalina.Store; import org.apache.catalina.util.LifecycleSupport; import org.apache.catalina.util.StringManager; /** * Abstract implementation of the Store interface to * support most of the functionality required by a Store. * * @author Bip Thelin * @version $Revision$, $Date$ */ public abstract class StoreBase implements Lifecycle, Runnable, Store { // - Instance Variables /** * The descriptive information about this implementation. */ protected static String info = "StoreBase/1.0"; /** * The interval (in seconds) between checks for expired sessions. */ protected int checkInterval = 60; /** * Name to register for the background thread. */
Re: JDBCStore package for Tomcat 4.x
"Craig R. McClanahan" wrote: > > [...] > > One of my original thoughts was along this line ... a Store should be > responsible for expiring its own swapped-out sessions. In practice, you > would have a background thread inside JDBCStore doing this for you. The > Store would also double check the current status while processing a > load(). That's how I've implemented it right now, but that won't do it now when Kief has migrated it to the PersistentManagerBase. I think that it's good to abstract the thread/Lifecycle methods up to the Manager but maybe we should keep the proccessexpires method in the Store so each Store is responsible for checking expired sessions in it's own best way upon triggered from the reaper thread in the Manager. ..bip
Re: JDBCStore package for Tomcat 4.x
Kief Morris wrote: > > [...] > > I think this is a good way to go about it: it looks like the table name can be >configured > in the server.xml file. Probably the column names should also maintained as JDBCStore > properties for configurability. Yes, that's why I wrote the last email to get some feedback on fields needed for the table. I'll implement it so it'll be configurable. > The table will need a column for the lastAccessedTime. And the ID column will need to > be something like CHAR, VARCHAR, or BYTE rather than an int. Yes, a typo from me. I looked at your latest patches for Persistentmanager and the Managerbase and it looks good. However we should come up with some smart solution when working with JDBCStore, the processexpires() in PersistentManagerBase is looking for current sessions then swaping them in and checking if they're valid, if so continue else invalidate. This is fine for FileStore but with JDBCStore this causes each session to be retrieved over the network(or where the RDBMS is located) just to check if the session is valid. Maybe we could add a method to the Store interface, i.e. public boolean isSessionValid(String sessionId) {}. What you would gain from this is that each Store is responsible for checking if expired in the way that's best for that particular Store, with JDBC you could do that in a single select statement without having to retrieve the data from the session(Assuming you save the lastaccesstime in the database, I'm currently working on that). ..bip
Re: JDBCStore package for Tomcat 4.x
"Craig R. McClanahan" wrote: > > [...] > > - Would it be possible to flesh out the rest of the JavaDoc comments? > I would like us to maintain the high quality level of JavaDocs that > Tomcat 4 is known for :-) Done. > - Would it be possible to parameterize the SQL statements used to > access the database? The idea would be that we can adapt to different > table and column names (like JDBCRealm does on the authentication side). Attatched is a slightly refactored JDBCStore with a "stub implementation" of a Connection pooled implementation. However before I change to much regarding specifying columns for the table I want to have som input on the following things. As it is implemented now everything is saved as a Blob so if you wan't to check if the session is invalid or is expired you have to retrive all data and iterate through every blob and make them into a session and THEN see if they are valid or not. I would like to propose that we save additional data in the database. The table would then look something like following: TABLE: [int ID] The ID for this session [boolean ISVALID] True if this session is valid [int MAXINACTIVE] The Max inactive attribute [Blob SESSION] The session object Then you could have a StoredProcedure if you want to that checks for timedout sessions and delete/invalidate them. The StoreProcedure way of doing is of course not the default behavior. I can now check every session for validity in the select query without having to retrieve the data. Thoughts? ..bip /* * JDBCStore.java * $Header$ * $Revision$ * $Date$ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.session; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.InputStream; import java.io.OutputStream; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamClass;
Re: JDBCStore package for Tomcat 4.x
"Craig R. McClanahan" wrote: > > [...] > > A couple of quick notes: > > - Would it be possible to flesh out the rest of the JavaDoc comments? > I would like us to maintain the high quality level of JavaDocs that > Tomcat 4 is known for :-) Flesh out? As in enhance the comments? Yes that's possible, when I'm done I could write up a little Howto on how to use it and how it works, a'la JDBCRealm. > - Would it be possible to parameterize the SQL statements used to > access the database? The idea would be that we can adapt to different > table and column names (like JDBCRealm does on the authentication side). Yes, and I acctually have some refactoring I would like to try out. Thanks for the comments and suggestions. ..bip
[PATCH PersistentManager.java] Patch to get the Max Idle Backup working
A little update to PersistentManager.java to backup sessions that's been Idle for longer than specified max time. ..bip Index: LocalStrings.properties === RCS file: /home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/LocalStrings.properties,v retrieving revision 1.4 diff -u -r1.4 LocalStrings.properties --- LocalStrings.properties 2001/02/03 20:36:20 1.4 +++ LocalStrings.properties 2001/04/10 02:16:05 @@ -37,6 +47,8 @@ persistentManager.deserializeError=Error deserializing Session {0}: {1} persistentManager.serializeError=Error deserializing Session {0}: {1} persistentManager.swapMaxIdle=Swapping session {0} to Store, idle for {1} seconds +persistentManager.backupMaxIdle=Backing up session {0} to Store, idle for {1} seconds +persistentManager.backupException=Exception occured when backing up Session {0}: {1} persistentManager.tooManyActive=Too many active sessions, {0}, looking for idle sessions to swap out persistentManager.swapTooManyActive=Swapping out session {0}, idle for {1} seconds too many sessions active persistentManager.processSwaps=Checking for sessions to swap out, {0} active sessions in memory Index: PersistentManager.java === RCS file: /home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/PersistentManager.java,v retrieving revision 1.3 diff -u -r1.3 PersistentManager.java --- PersistentManager.java 2001/04/07 10:25:03 1.3 +++ PersistentManager.java 2001/04/10 02:11:39 @@ -782,7 +782,32 @@ if (!started || maxIdleBackup < 0) return; - // FIXME: Do something useful + Session sessions[] = findSessions(); + long timeNow = System.currentTimeMillis(); + + // Back up all sessions idle longer than maxIdleBackup + if (maxIdleBackup >= 0) { + for (int i = 0; i < sessions.length; i++) { + StandardSession session = (StandardSession) sessions[i]; + if (!session.isValid()) + continue; + int timeIdle = // Truncate, do not round up + (int) ((timeNow - session.getLastAccessedTime()) / 1000L); + if (timeIdle > maxIdleBackup) { + if (debug > 1) + log(sm.getString +("persistentManager.backupMaxIdle", + session.getId(), new Integer(timeIdle))); + + try { + backup(session); + } catch (IOException e) { + log(sm.getString + ("persistentManager.backupException", session.getId( ), e)); + } + } + } + } } @@ -862,10 +887,18 @@ * Write the session out to Store, but leave the copy in * the Manager's memory unmodified. */ -private void backup() throws IOException { - -// FIXME: Do something +private void backup(Session session) throws IOException { + if (!session.isValid() +|| isSessionStale(session, System.currentTimeMillis())) + return; + try { + store.save(session); + } catch (IOException e) { + log(sm.getString +("persistentManager.serializeError", session.getId(), e)); + throw e; + } }
JDBCStore package for Tomcat 4.x
Here's the JDBCStore implementation. To use it change your server.xml to something like: You also have to create a table that has the fields id, session. And where id is a varchar field and session is a binary field, i.e. Blob. Sort of like: CREATE TABLE [dbo].[tomcat$sessions] ( [id] [varchar] (50) NOT NULL , [session] [binary] (1000) NULL ) However the SQL command varies from different RDBMS. ..bip - Index: LocalStrings.properties === RCS file: /home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/LocalStrings.properties,v retrieving revision 1.4 diff -u -r1.4 LocalStrings.properties --- LocalStrings.properties 2001/02/03 20:36:20 1.4 +++ LocalStrings.properties 2001/04/08 01:57:06 @@ -5,6 +5,16 @@ fileStore.saving=Saving Session {0} to file {1} fileStore.loading=Loading Session {0} from file {1} fileStore.removing=Removing Session {0} at file {1} +JDBCStore.alreadyStarted=JDBC Store has already been started +JDBCStore.notStarted=JDBC Store has not yet been started +JDBCStore.saving=Saving Session {0} to database {1} +JDBCStore.loading=Loading Session {0} from database {1} +JDBCStore.removing=Removing Session {0} at database {1} +JDBCStore.SQLException=SQL Error {0} +JDBCStore.checkConnectionDBClosed=The database connection is null or was found to be closed. Trying to re-open it. +JDBCStore.checkConnectionDBReOpenFail=The re-open on the database failed. The d atabase could be down. +JDBCStore.checkConnectionSQLException=A SQL exception occured {0} +JDBCStore.checkConnectionClassNotFoundException=JDBC driver class not found {0} managerBase.complete=Seeding of random number generator has been completed managerBase.getting=Getting message digest component for algorithm {0} managerBase.gotten=Completed getting message digest component /* * JDBCStore.java * $Header$ * $Revision$ * $Date$ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.session; import java.beans.PropertyChangeListener; import java.beans.Prope
[PATCH StandardSession] patch and additions to the Storeimplementations.
I took out the inline class CustomObjectInputStream from FileStore and put it in org.apache.catalina.util since I need it for the JDBCStore too. There's also a patch for StandardSession.java to return if the stream is null instead of giving a NullPointerException, maybe it should throw an Exception instead of returning? At least it won't corrupt the current Context if a session load is corrupt. ..bip Index: CustomObjectInputStream.java === /* * CustomObjectInputStream.java * $Header$ * $Revision$ * $Date$ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * "This product includes software developed by the *Apache Software Foundation (http://www.apache.org/)." *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software *Foundation" must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" *nor may "Apache" appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.catalina.util; import java.io.InputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectStreamClass; /** * Custom subclass of ObjectInputStream that loads from the * class loader for this web application. This allows classes defined only * with the web application to be found correctly. * * @author Craig R. McClanahan * @author Bip Thelin * @version $Revision$, $Date$ */ public final class CustomObjectInputStream extends ObjectInputStream { /** * The class loader we will use to resolve classes. */ private ClassLoader classLoader = null; /** * Construct a new instance of CustomObjectInputStream * * @param stream The input stream we will read from * @param classLoader The class loader used to instantiate objects * * @exception IOException if an input/output error occurs */ public CustomObjectInputStream(InputStream stream, ClassLoader classLoader) throws IOException { super(stream); this.classLoader = classLoader; } /** * Load the local class equivalent of the specified stream class * description, by using the class loader assigned to this Context. * * @param classDesc Class description from the input stream * * @exception ClassNotFoundException if this class cannot be found * @exception IOException if an input/output error occurs */ protected Class resolveClass(ObjectStreamClass classDesc) throws ClassNot
[PATCH] patch to make PersistentManager work with different Storeimplementations.
If you get this email twice please ignore. Our emailserver experienced problems yesterday so I never think my email was delivered. ..bip - This is a minor change so you can specify the store to use within server.xml. Here's how you can change the Store use from server.xml: I'll hope to have a first cut of the JDBCStore soon. ..bip [ PersistentManager.java ] diff -r1.2 PersistentManager.java 267c266 < --- > store.setManager(this); 598,601d596 < // Create the FileStore object. < // FIXME: Do this properly (configurable) < store = new FileStore(); < store.setManager (this); [ Catalina.java ] diff -r1.17 Catalina.java 351a352,358 > mapper.addRule("Server/Service/Engine/Host/Context/Manager/Store", > mapper.objectCreate(null, "className")); > mapper.addRule("Server/Service/Engine/Host/Context/Manager/Store", >mapper.setProperties()); > mapper.addRule("Server/Service/Engine/Host/Context/Manager/Store", > mapper.addChild("setStore", "org.apache.catalina.Store")); >
[PATCH] patch to make PersistentManager work with different Storeimplementations.
This is a minor change so you can specify the store to use within server.xml. Here's how you can change the Store use from server.xml: I'll hope to have a first cut of the JDBCStore soon. ..bip [ PersistentManager.java ] diff -r1.2 PersistentManager.java 267c266 < --- > store.setManager(this); 598,601d596 < // Create the FileStore object. < // FIXME: Do this properly (configurable) < store = new FileStore(); < store.setManager (this); [ Catalina.java ] diff -r1.17 Catalina.java 351a352,358 > mapper.addRule("Server/Service/Engine/Host/Context/Manager/Store", > mapper.objectCreate(null, "className")); > mapper.addRule("Server/Service/Engine/Host/Context/Manager/Store", >mapper.setProperties()); > mapper.addRule("Server/Service/Engine/Host/Context/Manager/Store", > mapper.addChild("setStore", "org.apache.catalina.Store")); >
Re: ? on SSI virtual & file
Amy Roh wrote: > > (1) According to NCSA "virtual gives a virtual path to a document on the > server." So no matter which context you're in, should try to access "test.txt" on your server's > root, right? Does virtual have to start with "/" always? I would think > so. If not, what should be the behavior if it doesn't start with "/", > context based? virtual gives a virtual path to a document on the server. You must access a normal file this way, you cannot access a CGI script in this fashion. You can, however, access another parsed document. I would say that tries to access test.txt in the server's root. However if you read the rfc on virtual paths you can also use ., .., instead of starting with a / so then the following examples would/should work: Which is a file in the current directory. Which is a file in the current directory. Which is a file in the "dir" directory _above_ the current directory. Which is a file on the servers root. Which is a file in the dir _below_ the current directory. > (2) Also, NCSA states "file gives a pathname relative to the current > directory." So obviously should try to > access "test.txt" in your current directory. What about ""? Should that look for "test.txt" on your server > root or on webapp? file gives a pathname relative to the current directory. ../ cannot be used in this pathname, nor can absolute paths be used. As above, you can send other parsed documents, but you cannot send CGI scripts. As i enterpret this you can _only_ access a file using the file command in the following ways: Which is a file in the current directory. Which is a file in the "dir" directory _above_ the current directory. Would fail. Would fail. And this is how it should be implemented right now. ..bip
Re: CGI support servlet (TC 4) -- feedback wanted
"Craig R. McClanahan" wrote: > > > > > > > 2) Addition to default context > > > > > > Would this CGI servlet be added to the default context similar to > > > SsiInvokerServlet? > > > > Yes. > > > > I would suggest that we do this, but leave it commented out. The reason > is that the potential for mischief is *much* larger when we are talking > about executing outside programs instead of just displaying content back > to a web browser. I vote for making the Tomcat sysadmin have to enable > this feature explicitly if they want it. > > Once we implement the #exec functionality in SSI, the same argument would > apply here -- unless we added a config option to disable the #exec by > default but left everything else alone. +1 on having CGI in web.xml but commented out, regarding SSI I suggest we add a configure property(like Apaches NoExec) that set's whether #exec is allowed or not. And if that property is not set it defaults to NoExec. So for a standard setup SSI would be allowed but you'd have to bug your Tomcat sysadmin to have the #exec option enabled. Sort of like a standard Apache setup. ..bip
Re: Behavior of new Server Side Include Functionality
"Craig R. McClanahan" wrote: > > > We can provide this option since this kind of makes sense in a web-app > > environment. However, I think the default way should be relative to the > > server's root following NCSA. What do you think? > > > > +1 on defaulting to NCSA rules, but I'd really like to see a configurable > option that virtual paths can be webapp-relative. Yes a webapp-relative option would seem good, but the option/standard way to run SSI should be NCSA compatible of course. You want to take this bug Amy? Let me know if you have any problems or need any help, I know I could of documented the code a bit better ;) ..bip
Re: JDBC-Session store
Grr, seems my message got stuck somewhere so I'll resend it. "Craig R. McClanahan" wrote: > > [...] > Kief, a while back (when the work on PersistentManager was going on), the > need for a little refactoring work on Manager vs. StandardManager would be > useful. Have you thought any more about what we should do here? I couldn't find anything about how to add the PersistenManager in server.xml or in the manuals, however, after backtracking the maillist I found a "patch" by Kief that seems to have been forgotten, I'll cat it to the end of this mail. Maybe it can find it's way into the server.xml after all. Cheers, Bip --[ server.xml patch from Kief Morris ] --- server.xml.orig Sat Dec 16 20:03:29 2000 +++ server.xml Fri Jan 12 22:01:04 2001 @@ -179,6 +179,53 @@ + +
JDBC-Session store
I've been looking at the FileStore implementation and you(Kief/Craig) basically store a java object in the textfile, using the same approach with a DB usually(?!) involves using a SQL3 capable RDBMS i.e. Oracle, since you probably want to store the object as a Blob or might even work with a STRUCT. Anyway, I'm kind of reluctant to save objects in to a RDBMS and sort or "overriding" the native formats. Have anyone got any ideas on how to solve this in a good way? Preferably so it would work with JDBC < 2.0 i.e., not use SQL3 datatypes. Otherwise I'll just go ahead and implement it as either a blob or a STRUCT whichever works out best. Thanks, Bip
Re: JDBC-Session store
"Craig R. McClanahan" wrote: > > [...] > Kief, a while back (when the work on PersistentManager was going on), the > need for a little refactoring work on Manager vs. StandardManager would be > useful. Have you thought any more about what we should do here? I couldn't find anything about how to add the PersistenManager in server.xml or in the manuals, however, after backtracking the maillist I found a "patch" by Kief that seems to have been forgotten, I'll cat it to the end of this mail. Maybe it can find it's way into the server.xml after all. Cheers, Bip --[ server.xml patch from Kief Morris ] --- server.xml.orig Sat Dec 16 20:03:29 2000 +++ server.xml Fri Jan 12 22:01:04 2001 @@ -179,6 +179,53 @@ + +
Re: JDBC-Session store
Kief Morris wrote: > > Excellent! Let us know if you need any help. I will, BTW how is the work on distributed sessions coming along? Is it possible to distribute sessions over x number of machines and that if one goes down you could go to the other and happily continue your session? ..bip
JDBC-Session store
According to the STATUS.html(which doesn't seem to be up to date) no one seems to have volunteered for the JDBC-Session store. If that is truly the case I would like to volunteer for that part. Thanks, Bip
SSI Update
Here's the latest version of the SSI package which now *fully* implements: Echo Config errmsg sizefmt timefmt Fsize flastmod include exec is the only command from the NCSA SSI standard that is not supported. Enjoy, Bip tomcat-4.x.SSI.zip
[Fwd: Re: TOMCAT 4.x SSI Status]
And here's the file I proMISSED. ..bip Original Message Subject: Re: TOMCAT 4.x SSI Status Date: Tue, 20 Mar 2001 17:20:30 -0800 From: Bip Thelin <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] Organization: Razorfish To: [EMAIL PROTECTED] References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Attached is the latest SSI package, it's not heavily tested. It supports expiration on the SSI page and buffering. Check below how to use it also ook below on what's implemented and what's not. Amy, check the files and mail me and we can decide how to work on the package towards a "stable" release. BTW; Anyone know where to buy those old pimp-ass Kung Fu movies in San Francisco? I'm talking about stuff like: 36chambers, Chess Boxing, 5 deadly Venoms, Wu-tang. Cheers, Bip --- ::: Implemented / Not implemented #+Echo #Config *errmsg *sizefmt timefmt #@Fsize flastmod exec #@include * == fully supported. # == partly supported. @ == virtual directive not supported. + == Missing enviromental variables: DOCUMENT_NAME: The current filename. DOCUMENT_URI: The virtual path to this document (such as /docs/tutorials/foo.shtml). QUERY_STRING_UNESCAPED: The unescaped version of any search query the client sent, with all shell-special characters escaped with \. DATE_LOCAL: The current date, local time zone. Subject to the timefmt parameter to the config command. DATE_GMT: Same as DATE_LOCAL but in Greenwich mean time. LAST_MODIFIED: The last modification date of the current document. Subject to timefmt like the others. ::: To use add the following to your web.xml: 8<-- ssi org.apache.catalina.servlets.SsiInvokerServlet debug 1 expires 666 buffered 1 5 ssi *.shtml 8<-- tomcat-4.x.SSI.zip