You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Conor MacNeill <co...@m64.com> on 2000/01/12 13:50:28 UTC

[PATCH] add option to stop tomcat.bat spawning a new window

This patch allows you, on NT, to not have tomcat run in a separate window.
Often the exception stacktrace from the tomcat window is lost as the window
disappears. This behaviour is achieved by adding a -nospawn option to the
tomcat.bat file.

I have also cleaned up this file to remove unnecessary (at least I think
they are unnecessary) echo statements. I have also changed the "syntax" of
the usage printout.

Index: src/shell/tomcat.bat
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/shell/tomcat.bat,v
retrieving revision 1.5
diff -u -r1.5 tomcat.bat
--- tomcat.bat  1999/12/12 14:18:38     1.5
+++ tomcat.bat  2000/01/12 12:40:31
@@ -5,6 +5,8 @@
 rem This batch file written and tested under Windows NT
 rem Improvements to this file are welcome

+set spawnCommand=start
+
 set jsdkJars=.\webserver.jar;.\lib\servlet.jar
 set jspJars=.\lib\jasper.jar
 set beanJars=.\webpages\WEB-INF\classes\jsp\beans;
@@ -23,27 +25,26 @@
 set CLASSPATH=%CLASSPATH%;%cp%

 :next
+if not "%1" == "-nospawn" goto noSpawnControl
+set spawnCommand=
+shift
+
+:noSpawnControl
 if "%1" == "start" goto startServer
 if "%1" == "stop" goto stopServer
-@echo on
-@echo Usage:
-@echo "tomcat [start|stop]"
-@echo off
+echo Usage:
+echo "tomcat [-nospawn] (start|stop)"
 goto cleanup

 :startServer
 rem Start the Tomcat Server
-@echo on
-@echo Using classpath: %CLASSPATH%
-@echo off
-start java org.apache.tomcat.shell.Startup %2 %3 %4 %5 %6 %7 %8 %9
+echo Using classpath: %CLASSPATH%
+%spawnCommand% java org.apache.tomcat.shell.Startup %2 %3 %4 %5 %6 %7 %8 %9
 goto cleanup

 :stopServer
 rem Stop the Tomcat Server
-@echo on
-@echo Using classpath: %CLASSPATH%
-@echo off
+echo Using classpath: %CLASSPATH%
 java org.apache.tomcat.shell.Shutdown %2 %3 %4 %5 %6 %7 %8 %9
 goto cleanup

--
Conor MacNeill
conor@m64.com
M64 Pty Limited