glenn 2002/12/08 05:42:11 Modified: catalina build.xml catalina/src/conf web.xml catalina/src/share/org/apache/catalina DefaultContext.java catalina/src/share/org/apache/catalina/core StandardContext.java StandardDefaultContext.java StandardWrapper.java catalina/src/share/org/apache/catalina/mbeans mbeans-descriptors.xml catalina/src/share/org/apache/catalina/realm LocalStrings.properties catalina/src/share/org/apache/catalina/servlets HTMLManagerServlet.java LocalStrings.properties ManagerServlet.java catalina/src/share/org/apache/catalina/session JDBCStore.java webapps/ROOT/WEB-INF web.xml webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context AddContextAction.java ContextForm.java EditContextAction.java SaveContextAction.java webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext AddDefaultContextAction.java DefaultContextForm.java EditDefaultContextAction.java SaveDefaultContextAction.java webapps/docs index.xml manager-howto.xml webapps/docs/WEB-INF web.xml webapps/docs/config context.xml defaultcontext.xml server.xml service.xml Added: catalina/src/temp README.txt Log: Port bug fixes and minor changes I made to Tomcat 4 to Tomcat 5 where appropriate. Revision Changes Path 1.34 +4 -0 jakarta-tomcat-catalina/catalina/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/build.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- build.xml 5 Dec 2002 15:41:37 -0000 1.33 +++ build.xml 8 Dec 2002 13:42:09 -0000 1.34 @@ -555,6 +555,10 @@ </fileset> </copy> + <!-- JVM Temporary Directory README --> + <copy todir="${catalina.build}/temp" + file="src/temp/README.txt"/> + <!-- Catalina Server Libraries --> <copy todir="${catalina.build}/server/lib" file="${commons-beanutils.jar}"/> 1.8 +25 -17 jakarta-tomcat-catalina/catalina/src/conf/web.xml Index: web.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/conf/web.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- web.xml 16 Nov 2002 04:20:57 -0000 1.7 +++ web.xml 8 Dec 2002 13:42:09 -0000 1.8 @@ -89,21 +89,34 @@ <!-- following initialization parameters (default values are in square --> <!-- brackets): --> <!-- --> + <!-- checkInterval If development is false and relaoding is true, --> + <!-- background compiles are enabled. checkInterval --> + <!-- is the time in seconds between checks to see --> + <!-- if a JSP page needs to be recompiled. [300] --> + <!-- --> + <!-- compiler Which compiler Ant should use to compile JSP --> + <!-- pages. See the Ant documenation for more --> + <!-- information. [javac] --> + <!-- --> <!-- classdebuginfo Should the class file be compiled with --> - <!-- debugging information? [false] --> + <!-- debugging information? [true] --> <!-- --> <!-- classpath What class path should I use while compiling --> <!-- generated servlets? [Created dynamically --> <!-- based on the current web application] --> <!-- --> + <!-- development Is Jasper used in development mode (will check --> + <!-- for JSP modification on every access)? [true] --> + <!-- --> + <!-- enablePooling Determines whether tag handler pooling is --> + <!-- enabled [true] --> + <!-- --> <!-- ieClassId The class-id value to be sent to Internet --> <!-- Explorer when using <jsp:plugin> tags. --> <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] --> <!-- --> - <!-- jspCompilerPlugin The fully qualified class name of the JSP --> - <!-- compiler plug-in to be used. See below for --> - <!-- more information. --> - <!-- [Use internal JDK compiler] --> + <!-- javaEncoding Java file encoding to use for generating java --> + <!-- source files. [UTF8] --> <!-- --> <!-- keepgenerated Should we keep the generated Java source code --> <!-- for each page instead of deleting it? [true] --> @@ -112,11 +125,6 @@ <!-- pages in external data files, to reduce the --> <!-- size of the generated servlets? [false] --> <!-- --> - <!-- enablePooling Determines whether tag handler pooling is --> - <!-- enabled [true] --> - <!-- --> - <!-- tagPoolSize The tag handler pool size --> - <!-- --> <!-- logVerbosityLevel The level of detailed messages to be produced --> <!-- by this servlet. Increasing levels cause the --> <!-- generation of more messages. Valid values are --> @@ -129,18 +137,18 @@ <!-- --> <!-- reloading Should Jasper check for modified JSPs? [true] --> <!-- --> - <!-- development Is Jasper used in development mode (will check --> - <!-- for JSP modification on every access)? [true] --> - <!-- --> <!-- scratchdir What scratch directory should we use when --> <!-- compiling JSP pages? [default work directory --> <!-- for the current web application] --> <!-- --> + <!-- tagPoolSize The tag handler pool size --> + <!-- --> <!-- If you wish to use Jikes to compile JSP pages: --> - <!-- * Set the "classpath" initialization parameter appropriately --> - <!-- for this web application. --> - <!-- * Set the "jspCompilerPlugin" initialization parameter to --> - <!-- "org.apache.jasper.compiler.JikesJavaCompiler". --> + <!-- Set the init parameter "compiler" to "jikes". Define --> + <!-- the property "-Dbuild.compiler.emacs=true" when starting Tomcat --> + <!-- by adding the above to your CATALINA_OPTS environment variable. --> + <!-- If you get an error reporting that jikes can't use UTF8 encoding, --> + <!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". --> <servlet> <servlet-name>jsp</servlet-name> 1.4 +4 -16 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/DefaultContext.java Index: DefaultContext.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/DefaultContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DefaultContext.java 20 Sep 2002 21:22:31 -0000 1.3 +++ DefaultContext.java 8 Dec 2002 13:42:09 -0000 1.4 @@ -93,18 +93,6 @@ /** - * Returns true if the internal naming support is used. - */ - public boolean isUseNaming(); - - - /** - * Enables or disables naming. - */ - public void setUseNaming(boolean useNaming); - - - /** * Return the "use cookies for session ids" flag. */ public boolean getCookies(); 1.12 +53 -6 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java Index: StandardContext.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- StandardContext.java 5 Dec 2002 12:23:37 -0000 1.11 +++ StandardContext.java 8 Dec 2002 13:42:09 -0000 1.12 @@ -146,7 +146,7 @@ import org.apache.catalina.util.ExtensionValidator; import org.apache.catalina.util.RequestUtil; - +import org.apache.tomcat.util.log.SystemLogHandler; /** * Standard implementation of the <b>Context</b> interface. Each @@ -438,6 +438,13 @@ /** + * Set flag to true to cause the system.out and system.err to be redirected + * to the logger when executing a servlet. + */ + private boolean swallowOutput = false; + + + /** * The JSP tag libraries for this web application, keyed by URI */ private HashMap taglibs = new HashMap(); @@ -1124,6 +1131,34 @@ /** + * Return the value of the swallowOutput flag. + */ + public boolean getSwallowOutput() { + + return (this.swallowOutput); + + } + + + /** + * Set the value of the swallowOutput flag. If set to true, the system.out + * and system.err will be redirected to the logger during a servlet + * execution. + * + * @param swallowOuptut The new value + */ + public void setSwallowOutput(boolean swallowOutput) { + + boolean oldSwallowOutput = this.swallowOutput; + this.swallowOutput = swallowOutput; + support.firePropertyChange("swallowOutput", + new Boolean(oldSwallowOutput), + new Boolean(this.swallowOutput)); + + } + + + /** * Return the Java class name of the Wrapper implementation used * for servlets registered in this Context. */ @@ -2521,7 +2556,19 @@ } // Normal request processing - super.invoke(request, response); + if (swallowOutput) { + try { + SystemLogHandler.startCapture(); + super.invoke(request, response); + } finally { + String log = SystemLogHandler.stopCapture(); + if (log != null && log.length() > 0) { + log(log); + } + } + } else { + super.invoke(request, response); + } } 1.4 +33 -4 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardDefaultContext.java Index: StandardDefaultContext.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardDefaultContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- StandardDefaultContext.java 13 Nov 2002 14:35:55 -0000 1.3 +++ StandardDefaultContext.java 8 Dec 2002 13:42:09 -0000 1.4 @@ -197,6 +197,12 @@ /** + * The swallowOutput flag for this web application. + */ + private boolean swallowOutput = false; + + + /** * The set of classnames of LifecycleListeners that will be added * to each newly created Wrapper by <code>createWrapper()</code>. */ @@ -367,6 +373,28 @@ /** + * Return the swallowOutput flag for this web application. + */ + public boolean getSwallowOutput() { + + return (this.swallowOutput); + + } + + + /** + * Set the swallowOutput flag for this web application. + * + * @param swallowOutput The new swallowOutput flag + */ + public void setSwallowOutput(boolean swallowOutput) { + boolean oldSwallowOutput = this.swallowOutput; + this.swallowOutput = swallowOutput; + + } + + + /** * Return the Java class name of the Wrapper implementation used * for servlets registered in this Context. */ @@ -1323,6 +1351,7 @@ if (context instanceof StandardContext) { ((StandardContext)context).setUseNaming(isUseNaming()); + ((StandardContext)context).setSwallowOutput(getSwallowOutput()); if (!contexts.containsKey(context)) { ((StandardContext) context).addLifecycleListener(this); } 1.10 +40 -11 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java Index: StandardWrapper.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- StandardWrapper.java 5 Dec 2002 13:34:09 -0000 1.9 +++ StandardWrapper.java 8 Dec 2002 13:42:09 -0000 1.10 @@ -241,6 +241,11 @@ private Stack instancePool = null; + /** + * Should we swallow System.out + */ + private boolean swallowOutput = false; + // ------------------------------------------------------------- Properties @@ -452,6 +457,9 @@ !(container instanceof Context)) throw new IllegalArgumentException (sm.getString("standardWrapper.notContext")); + if (container instanceof StandardContext) { + swallowOutput = ((StandardContext)container).getSwallowOutput(); + } super.setParent(container); } @@ -819,7 +827,10 @@ return instance; PrintStream out = System.out; - SystemLogHandler.startCapture(); + if (swallowOutput) { + SystemLogHandler.startCapture(); + } + Servlet servlet; try { long t1=System.currentTimeMillis(); @@ -987,12 +998,14 @@ (System.currentTimeMillis() - t1 ) ); } } finally { - String log = SystemLogHandler.stopCapture(); - if (log != null && log.length() > 0) { - if (getServletContext() != null) { - getServletContext().log(log); - } else { - out.println(log); + if (swallowOutput) { + String log = SystemLogHandler.stopCapture(); + if (log != null && log.length() > 0) { + if (getServletContext() != null) { + getServletContext().log(log); + } else { + out.println(log); + } } } } @@ -1124,6 +1137,11 @@ Thread.currentThread().getContextClassLoader(); ClassLoader classLoader = instance.getClass().getClassLoader(); + PrintStream out = System.out; + if (swallowOutput) { + SystemLogHandler.startCapture(); + } + // Call the servlet destroy() method try { instanceSupport.fireInstanceEvent @@ -1153,6 +1171,17 @@ } finally { // restore the context ClassLoader Thread.currentThread().setContextClassLoader(oldCtxClassLoader); + // Write captured output + if (swallowOutput) { + String log = SystemLogHandler.stopCapture(); + if (log != null && log.length() > 0) { + if (getServletContext() != null) { + getServletContext().log(log); + } else { + out.println(log); + } + } + } } // Deregister the destroyed instance 1.14 +11 -1 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml Index: mbeans-descriptors.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mbeans-descriptors.xml 5 Dec 2002 12:26:08 -0000 1.13 +++ mbeans-descriptors.xml 8 Dec 2002 13:42:09 -0000 1.14 @@ -348,6 +348,11 @@ description="The reloadable flag for this web application" type="boolean"/> + <attribute name="swallowOutput" + description="Flag to set to cause the system.out and system.err + to be redirected to the logger when executing a servlet" + type="boolean"/> + <attribute name="useNaming" description="Create JNDI naming context?" is="true" @@ -1997,6 +2002,11 @@ for this application." type="java.lang.String[]" writeable="false"/> + + <attribute name="swallowOutput" + description="Flag to set to cause the system.out and system.err + to be redirected to the logger when executing a servlet" + type="boolean"/> <attribute name="useNaming" description="Create a JNDI naming context for this application?" 1.3 +6 -2 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/LocalStrings.properties Index: LocalStrings.properties =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/LocalStrings.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalStrings.properties 7 Aug 2002 20:51:44 -0000 1.2 +++ LocalStrings.properties 8 Dec 2002 13:42:10 -0000 1.3 @@ -39,4 +39,8 @@ userDatabaseRealm.noDatabase=No UserDatabase component found under key {0} userDatabaseRealm.noEngine=No Engine component found in container hierarchy userDatabaseRealm.noGlobal=No global JNDI resources context found - +dataSourceRealm.authenticateFailure=Username {0} NOT successfully authenticated +dataSourceRealm.authenticateSuccess=Username {0} successfully authenticated +dataSourceRealm.close=Exception closing database connection +dataSourceRealm.exception=Exception performing authentication +dataSourceRealm.open=Exception opening database connection 1.4 +19 -5 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/HTMLManagerServlet.java Index: HTMLManagerServlet.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/HTMLManagerServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HTMLManagerServlet.java 18 Sep 2002 14:13:45 -0000 1.3 +++ HTMLManagerServlet.java 8 Dec 2002 13:42:10 -0000 1.4 @@ -261,7 +261,10 @@ args[2] = appsStop; args[3] = appsReload; args[4] = appsRemove; - if (context.getAvailable()) { + if (context.getPath().equals(this.context.getPath())) { + writer.print(MessageFormat.format( + MANAGER_APP_ROW_BUTTON_SECTION, args)); + } else if (context.getAvailable()) { writer.print(MessageFormat.format( STARTED_APPS_ROW_BUTTON_SECTION, args)); } else { @@ -508,6 +511,17 @@ " <td class=\"row-center\"><small>{2}</small></td> \n" + " <td class=\"row-center\">" + "<small><a href=\"sessions?path={0}\">{3}</a></small></td> \n"; + + private static final String MANAGER_APP_ROW_BUTTON_SECTION = + " <td class=\"row-left\"> \n" + + " <small> \n" + + " {1} \n" + + " {2} \n" + + " {3} \n" + + " {4} \n" + + " </small> \n" + + " </td> \n" + + "</tr> \n"; private static final String STARTED_APPS_ROW_BUTTON_SECTION = " <td class=\"row-left\"> \n" + 1.2 +1 -0 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/LocalStrings.properties Index: LocalStrings.properties =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/LocalStrings.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LocalStrings.properties 18 Jul 2002 16:47:40 -0000 1.1 +++ LocalStrings.properties 8 Dec 2002 13:42:10 -0000 1.2 @@ -56,6 +56,7 @@ {0} managerServlet.noRename=FAIL - Cannot deploy uploaded WAR for path {0} managerServlet.noRole=FAIL - User does not possess role {0} +managerServlet.noSelf=FAIL - The manager can not reload, remove, stop, or undeploy itself managerServlet.noWrapper=Container has not called setWrapper() for this servlet managerServlet.reloaded=OK - Reloaded application at context path {0} 1.4 +25 -4 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java Index: ManagerServlet.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/ManagerServlet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ManagerServlet.java 18 Sep 2002 14:13:45 -0000 1.3 +++ ManagerServlet.java 8 Dec 2002 13:42:10 -0000 1.4 @@ -732,6 +732,11 @@ writer.println(sm.getString("managerServlet.noReload", displayPath)); return; } + // It isn't possible for the manager to reload itself + if (context.getPath().equals(this.context.getPath())) { + writer.println(sm.getString("managerServlet.noSelf")); + return; + } context.reload(); writer.println(sm.getString("managerServlet.reloaded", displayPath)); } catch (Throwable t) { @@ -768,6 +773,11 @@ writer.println(sm.getString("managerServlet.noContext", displayPath)); return; } + // It isn't possible for the manager to remove itself + if (context.getPath().equals(this.context.getPath())) { + writer.println(sm.getString("managerServlet.noSelf")); + return; + } deployer.remove(path); writer.println(sm.getString("managerServlet.removed", displayPath)); } catch (Throwable t) { @@ -1045,6 +1055,11 @@ writer.println(sm.getString("managerServlet.noContext", displayPath)); return; } + // It isn't possible for the manager to stop itself + if (context.getPath().equals(this.context.getPath())) { + writer.println(sm.getString("managerServlet.noSelf")); + return; + } deployer.stop(path); writer.println(sm.getString("managerServlet.stopped", displayPath)); } catch (Throwable t) { @@ -1117,6 +1132,12 @@ if (debug >= 2) { log("Undeploying document base " + docBasePath); } + // It isn't possible for the manager to undeploy itself + if (context.getPath().equals(this.context.getPath())) { + writer.println(sm.getString("managerServlet.noSelf")); + return; + } + deployer.remove(path); if (docBaseDir.isDirectory()) { undeployDir(docBaseDir); 1.2 +40 -28 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/session/JDBCStore.java Index: JDBCStore.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/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.java 18 Jul 2002 16:47:51 -0000 1.1 +++ JDBCStore.java 8 Dec 2002 13:42:10 -0000 1.2 @@ -758,40 +758,52 @@ ; } - try { - preparedSizeSql.close(); - } catch (SQLException e) { - ; + if( preparedSizeSql != null ) { + try { + preparedSizeSql.close(); + } catch (SQLException e) { + ; + } } - try { - preparedKeysSql.close(); - } catch (SQLException e) { - ; + if( preparedKeysSql != null ) { + try { + preparedKeysSql.close(); + } catch (SQLException e) { + ; + } } - try { - preparedSaveSql.close(); - } catch (SQLException e) { - ; + if( preparedSaveSql != null ) { + try { + preparedSaveSql.close(); + } catch (SQLException e) { + ; + } } - try { - preparedClearSql.close(); - } catch (SQLException e) { - ; + if( preparedClearSql != null ) { + try { + preparedClearSql.close(); + } catch (SQLException e) { + ; + } } - try { - preparedRemoveSql.close(); - } catch (SQLException e) { - ; + if( preparedRemoveSql != null ) { + try { + preparedRemoveSql.close(); + } catch (SQLException e) { + ; + } } - try { - preparedLoadSql.close(); - } catch (SQLException e) { - ; + if( preparedLoadSql != null ) { + try { + preparedLoadSql.close(); + } catch (SQLException e) { + ; + } } try { 1.1 jakarta-tomcat-catalina/catalina/src/temp/README.txt Index: README.txt =================================================================== This temp directory is used by the JVM for temporary file storage. The JVM is configured to use this as its java.io.tmpdir in the catalina.sh and catalina.bat scripts. Tomcat is configured to use this temporary directory rather than its default for security reasons. The temp directory must exist for Tomcat to work correctly. 1.2 +4 -0 jakarta-tomcat-catalina/webapps/ROOT/WEB-INF/web.xml Index: web.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/ROOT/WEB-INF/web.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- web.xml 18 Jul 2002 16:48:41 -0000 1.1 +++ web.xml 8 Dec 2002 13:42:10 -0000 1.2 @@ -5,4 +5,8 @@ "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> + <display-name>Welcome to Tomcat</display-name> + <description> + Welcome to Tomcat + </description> </web-app> 1.2 +5 -4 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/AddContextAction.java Index: AddContextAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/AddContextAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AddContextAction.java 18 Jul 2002 16:48:26 -0000 1.1 +++ AddContextAction.java 8 Dec 2002 13:42:10 -0000 1.2 @@ -143,6 +143,7 @@ contextFm.setOverride("false"); contextFm.setPath(""); contextFm.setReloadable("false"); + contextFm.setSwallowOutput("false"); contextFm.setUseNaming("false"); contextFm.setWorkDir(""); contextFm.setPath(""); 1.2 +33 -5 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/ContextForm.java Index: ContextForm.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/ContextForm.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ContextForm.java 18 Jul 2002 16:48:26 -0000 1.1 +++ ContextForm.java 8 Dec 2002 13:42:10 -0000 1.2 @@ -145,7 +145,12 @@ * The text for reloadable boolean. */ private String reloadable = "false"; - + + /** + * The text for swallowOutput boolean. + */ + private String swallowOutput = "false"; + /** * The text for use naming boolean. */ @@ -489,6 +494,25 @@ } /** + * Return the swallowOutput boolean value. + */ + + public String getSwallowOutput() { + + return this.swallowOutput; + + } + + /** + * Set the swallowOutput value. + */ + public void setSwallowOutput(String swallowOutput) { + + this.swallowOutput = swallowOutput; + + } + + /** * Return the use naming boolean value. */ @@ -678,6 +702,7 @@ this.override= "false"; this.path = null; this.reloadable = "false"; + this.swallowOutput = "false"; // loader properties this.ldrCheckInterval = "15"; @@ -712,6 +737,9 @@ sb.append(override); sb.append(",reloadable="); sb.append(reloadable); + sb.append(",swallowOutput="); + sb.append(swallowOutput); + // loader properties sb.append(",ldrCheckInterval="); sb.append(ldrCheckInterval); 1.2 +7 -4 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/EditContextAction.java Index: EditContextAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/EditContextAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EditContextAction.java 18 Jul 2002 16:48:26 -0000 1.1 +++ EditContextAction.java 8 Dec 2002 13:42:10 -0000 1.2 @@ -250,6 +250,9 @@ attribute = "reloadable"; contextFm.setReloadable (((Boolean) mBServer.getAttribute(cname, attribute)).toString()); + attribute = "swallowOutput"; + contextFm.setSwallowOutput + (((Boolean) mBServer.getAttribute(cname, attribute)).toString()); attribute = "override"; contextFm.setOverride (((Boolean) mBServer.getAttribute(cname, attribute)).toString()); 1.4 +14 -4 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/SaveContextAction.java Index: SaveContextAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/SaveContextAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SaveContextAction.java 18 Sep 2002 19:16:07 -0000 1.3 +++ SaveContextAction.java 8 Dec 2002 13:42:10 -0000 1.4 @@ -342,6 +342,16 @@ mBServer.setAttribute(coname, new Attribute("reloadable", new Boolean(reloadable))); + attribute = "swallowOutput"; + String swallowOutput = "false"; + try { + swallowOutput = cform.getSwallowOutput(); + } catch (Throwable t) { + swallowOutput = "false"; + } + mBServer.setAttribute(coname, + new Attribute("swallowOutput", new Boolean(swallowOutput))); + attribute = "useNaming"; String useNaming = "false"; try { 1.3 +5 -4 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/AddDefaultContextAction.java Index: AddDefaultContextAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/AddDefaultContextAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- AddDefaultContextAction.java 20 Sep 2002 21:22:59 -0000 1.2 +++ AddDefaultContextAction.java 8 Dec 2002 13:42:10 -0000 1.3 @@ -152,6 +152,7 @@ defaultContextFm.setCookies("true"); defaultContextFm.setCrossContext("true"); defaultContextFm.setReloadable("false"); + defaultContextFm.setSwallowOutput("false"); defaultContextFm.setUseNaming("true"); //loader initialization defaultContextFm.setLdrCheckInterval("15"); 1.2 +30 -3 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/DefaultContextForm.java Index: DefaultContextForm.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/DefaultContextForm.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DefaultContextForm.java 16 Sep 2002 04:48:38 -0000 1.1 +++ DefaultContextForm.java 8 Dec 2002 13:42:10 -0000 1.2 @@ -127,6 +127,11 @@ private String reloadable = "false"; /** + * The text for swallowOutput boolean. + */ + private String swallowOutput = "false"; + + /** * The text for use naming boolean. */ private String useNaming = "true"; @@ -383,6 +388,25 @@ } /** + * Return the swallowOutput boolean value. + */ + + public String getSwallowOutput() { + + return this.swallowOutput; + + } + + /** + * Set the swallowOutput value. + */ + public void setSwallowOutput(String swallowOutput) { + + this.swallowOutput = swallowOutput; + + } + + /** * Return the use naming boolean value. */ @@ -549,6 +573,7 @@ this.cookies = "true"; this.crossContext = "true"; this.reloadable = "false"; + this.swallowOutput = "false"; this.useNaming = "true"; // loader properties @@ -576,6 +601,8 @@ sb.append(crossContext); sb.append(",reloadable="); sb.append(reloadable); + sb.append(",swallowOutput="); + sb.append(swallowOutput); sb.append(",useNaming="); sb.append(useNaming); // loader properties 1.3 +7 -4 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/EditDefaultContextAction.java Index: EditDefaultContextAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/EditDefaultContextAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EditDefaultContextAction.java 20 Sep 2002 21:22:59 -0000 1.2 +++ EditDefaultContextAction.java 8 Dec 2002 13:42:10 -0000 1.3 @@ -238,6 +238,9 @@ attribute = "reloadable"; defaultContextFm.setReloadable (((Boolean) mBServer.getAttribute(cname, attribute)).toString()); + attribute = "swallowOutput"; + defaultContextFm.setSwallowOutput + (((Boolean) mBServer.getAttribute(cname, attribute)).toString()); // loader properties attribute = "debug"; 1.4 +14 -4 jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/SaveDefaultContextAction.java Index: SaveDefaultContextAction.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/defaultcontext/SaveDefaultContextAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SaveDefaultContextAction.java 20 Sep 2002 21:22:59 -0000 1.3 +++ SaveDefaultContextAction.java 8 Dec 2002 13:42:10 -0000 1.4 @@ -302,6 +302,16 @@ mBServer.setAttribute(coname, new Attribute("reloadable", new Boolean(reloadable))); + attribute = "swallowOutput"; + String swallowOutput = "false"; + try { + swallowOutput = cform.getSwallowOutput(); + } catch (Throwable t) { + swallowOutput = "false"; + } + mBServer.setAttribute(coname, + new Attribute("swallowOutput", new Boolean(swallowOutput))); + attribute = "useNaming"; String useNaming = "false"; try { 1.3 +8 -0 jakarta-tomcat-catalina/webapps/docs/index.xml Index: index.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/index.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- index.xml 30 Jul 2002 03:58:28 -0000 1.2 +++ index.xml 8 Dec 2002 13:42:10 -0000 1.3 @@ -64,6 +64,14 @@ <li><a href="class-loader-howto.html"><strong>Class Loader HOW-TO</strong></a> - Information about class loading in Tomcat 5, including where to place your application classes so that they are visible.</li> +<li><a href="jk2/index.html"><strong>JK Documenation</strong></a> + - Complete documentation and HOWTOs on the JK native webserver connector, + used to interface Tomcat with servers like Apache HTTPd, IIS + and others.</li> +<li><a href="jndi-datasource-examples-howto.html"> + <strong>JNDI DataSource HOW-TO</strong></a> + - Configuring a JNDI DataSoure with a dB connection pool. + Examples for many popular databases.</li> <li><a href="jndi-resources-howto.html"><strong>JNDI Resources HOW-TO</strong></a> - Configuring standard and custom resources in the JNDI naming context that is provided to each web application.</li> 1.3 +50 -12 jakarta-tomcat-catalina/webapps/docs/manager-howto.xml Index: manager-howto.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/manager-howto.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- manager-howto.xml 30 Jul 2002 03:58:28 -0000 1.2 +++ manager-howto.xml 8 Dec 2002 13:42:10 -0000 1.3 @@ -48,15 +48,45 @@ directory.</li> </ul> -<p>Since <code>Manager</code> is itself a web application, it interacts with -you using standard HTTP requests and responses. However, it's "user interface" -is minimal, because it is intended to be accessed from scripts set up by the -system administrator. For this reason, commands are given as part of the +<p>There are two ways to configure the Manager web application +<code>Context</code>: +<ul> +<li>Install the <code>manager.xml</code> context configuration file + in the <code>appBase</code> for your <code>Host</code>.</li> +<li>Configure the Manager <code>Context</code> within the + <code>Host</code> configuration in your Tomcat <code>server.xml</code> + configuration. Here is an example: +<pre> +<Context path="/manager" debug="0" privileged="true" + docBase="/usr/local/kinetic/tomcat4/server/webapps/manager"> +</Context> +</pre> +</li> +</ul> +</p> + +<p>If you have Tomcat configured to support multiple virtual hosts +(websites) you would need to configure a Manager for each.</p> + +<p>There are three ways to use the <code>Manager</code> web application. +<ul> +<li>As an application with a user interface you use in your browser. +Here is an example URL where you can replace <code>localhost</code> with +your website host name: <code>http://localhost/manager/html/</code> .</li> +<li>A minimal version using HTTP requests only which is suitable for use +by scripts setup by system administrators. Commands are given as part of the request URI, and responses are in the form of simple text that can be easily -parsed and processed.</p> +parsed and processed. See <a href="#Supported Manager Commands"> +Supported Manager Commands</a> for more information.</li> +<li>A convenient set of task definitions for the <em>Ant</em> +(version 1.4 or later) build tool. See +<a href="#Executing Manager Commands With Ant">Executing Manager Commands +With Ant</a> for more information.</li> +</ul> +</p> <p>Future versions of Tomcat 5 will include administrative functionality that -is presented in (at least) the following forms:</p> +is presented in (at least) the following forms: <ul> <li>As web services, so that Tomcat administration can be easily integrated into remote and/or non-Java mnagement environments.</li> @@ -64,12 +94,7 @@ web services processing layer) for easy Tomcat administration via a web browser.</li> </ul> - -<p>In addition to executing Manager commands directly via HTTP, Tomcat 5 -includes a convenient set of task definitions for the <em>Ant</em> -(version 1.4 or later) build tool. See -<a href="#Executing Manager Commands With Ant">Executing Manager Commands -With Ant</a> for more information.</p> +</p> </section> @@ -133,6 +158,19 @@ BASIC authentication. The username and password you enter do not matter, as long as they identify a valid user in the users database who possesses the role <strong>manager</strong>.</p> + +<p>In addition to the password restrictions the manager web application +could be restricted by the remote IP address or host by adding a +<code>RemoteAddrValve</code> or <code>RemoteHostValve</code>. Here is +an example of restricting access to the localhost by IP address: +<pre> +<Context path="/manager" debug="0" privileged="true" + docBase="/usr/local/kinetic/tomcat4/server/webapps/manager"> + <Valve className="org.apache.catalina.valves.RemoteAddrValve" + allow="127.0.0.1"/> +</Context> +</pre> +</p> </section> 1.2 +4 -0 jakarta-tomcat-catalina/webapps/docs/WEB-INF/web.xml Index: web.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/WEB-INF/web.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- web.xml 18 Jul 2002 16:48:39 -0000 1.1 +++ web.xml 8 Dec 2002 13:42:11 -0000 1.2 @@ -5,4 +5,8 @@ "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> + <display-name>Tomcat Documentation</display-name> + <description> + Tomcat Documentation. + </description> </web-app> 1.3 +14 -7 jakarta-tomcat-catalina/webapps/docs/config/context.xml Index: context.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/config/context.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- context.xml 30 Jul 2002 03:58:28 -0000 1.2 +++ context.xml 8 Dec 2002 13:42:11 -0000 1.3 @@ -149,13 +149,6 @@ on demand.</p> </attribute> - <attribute name="useNaming" required="false"> - <p>Set to <code>true</code> (the default) to have Catalina enable a - JNDI <code>InitialContext</code> for this web application that is - compatible with Java2 Enterprise Edition (J2EE) platform - conventions.</p> - </attribute> - <attribute name="wrapperClass" required="false"> <p>Java class name of the <code>org.apache.catalina.Wrapper</code> implementation class that will be used for servlets managed by this @@ -181,6 +174,20 @@ to the associated <a href="logger.html">Logger</a>. Higher numbers generate more detailed output. If not specified, the default debugging detail level is zero (0).</p> + </attribute> + + <attribute name="swallowOutput" required="false"> + <p>If the value of this flag is <code>true</code>, the bytes output to + System.out and System.err by the web application will be redirected to + the web application logger. If not specified, the default value + of the flag is <code>false</code>.</p> + </attribute> + + <attribute name="useNaming" required="false"> + <p>Set to <code>true</code> (the default) to have Catalina enable a + JNDI <code>InitialContext</code> for this web application that is + compatible with Java2 Enterprise Edition (J2EE) platform + conventions.</p> </attribute> <attribute name="workDir" required="false"> 1.2 +15 -7 jakarta-tomcat-catalina/webapps/docs/config/defaultcontext.xml Index: defaultcontext.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/config/defaultcontext.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- defaultcontext.xml 18 Jul 2002 16:48:35 -0000 1.1 +++ defaultcontext.xml 8 Dec 2002 13:42:11 -0000 1.2 @@ -71,13 +71,6 @@ on demand.</p> </attribute> - <attribute name="useNaming" required="false"> - <p>Set to <code>true</code> (the default) to have Catalina enable a - JNDI <code>InitialContext</code> for this web application that is - compatible with Java2 Enterprise Edition (J2EE) platform - conventions.</p> - </attribute> - <attribute name="wrapperClass" required="false"> <p>Java class name of the <code>org.apache.catalina.Wrapper</code> implementation class that will be used for servlets managed by this @@ -97,6 +90,21 @@ common attributes listed above):</p> <attributes> + + <attribute name="swallowOutput" required="false"> + <p>If the value of this flag is <code>true</code>, the bytes output to + System.out and System.err by the web application will be redirected to + the web application logger. If not specified, the default value + of the flag is <code>false</code>.</p> + </attribute> + + <attribute name="useNaming" required="false"> + <p>Set to <code>true</code> (the default) to have Catalina enable a + JNDI <code>InitialContext</code> for this web application that is + compatible with Java2 Enterprise Edition (J2EE) platform + conventions.</p> + </attribute> + </attributes> </subsection> 1.2 +8 -1 jakarta-tomcat-catalina/webapps/docs/config/server.xml Index: server.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/config/server.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- server.xml 18 Jul 2002 16:48:37 -0000 1.1 +++ server.xml 8 Dec 2002 13:42:11 -0000 1.2 @@ -58,7 +58,14 @@ It supports the following additional attributes (in addition to the common attributes listed above):</p> - <attributes/> + <attributes> + <attribute name="debug" required="false"> + <p>The level of debugging detail logged by this <strong>Server</strong> + to the associated <a href="logger.html">Logger</a>. Higher numbers + generate more detailed output. If not specified, the default + debugging detail level is zero (0).</p> + </attribute> + </attributes> </subsection> 1.2 +8 -1 jakarta-tomcat-catalina/webapps/docs/config/service.xml Index: service.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/config/service.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- service.xml 18 Jul 2002 16:48:37 -0000 1.1 +++ service.xml 8 Dec 2002 13:42:11 -0000 1.2 @@ -57,7 +57,14 @@ It supports the following additional attributes (in addition to the common attributes listed above):</p> - <attributes/> + <attributes> + <attribute name="debug" required="false"> + <p>The level of debugging detail logged by this <strong>Service</strong> + to the associated <a href="logger.html">Logger</a>. Higher numbers + generate more detailed output. If not specified, the default + debugging detail level is zero (0).</p> + </attribute> + </attributes> </subsection>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>