Index: src/org/netbeans/modules/tomcat5/TomcatManager.java =================================================================== RCS file: /cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/TomcatManager.java,v retrieving revision 1.70 diff -u -r1.70 TomcatManager.java --- src/org/netbeans/modules/tomcat5/TomcatManager.java 2 Apr 2005 12:44:48 -0000 1.70 +++ src/org/netbeans/modules/tomcat5/TomcatManager.java 9 Apr 2005 10:18:29 -0000 @@ -1305,7 +1305,7 @@ String [] patternFrom = new String [] { null, null, - "", // NOI18N + null, "", // NOI18N null, "docBase=\"../server/webapps/admin\"", // NOI18N For bundled tomcat 5.0.x @@ -1320,11 +1320,7 @@ String [] patternTo = new String [] { null, null, - "\n"+ - // jsp/servlet examples can be created as sample projects now, so this doesn't need to be here anymore - //"\n"+ - //"\n"+ - "", // NOI18N + null, passwd != null ? "\n" : null, // NOI18N null, "docBase=\"${catalina.home}/server/webapps/admin\"", // NOI18N For bundled tomcat 5.0.x @@ -1373,7 +1369,12 @@ } } } - } + } + // deploy the ROOT context, if exists + if (new File(homeDir, "webapps/ROOT").exists()) { // NOI18N + writeToFile(new File(baseDir, "conf/Catalina/localhost/ROOT.xml"), // NOI18N + "\n"); // NOI18N + } } catch (java.io.IOException ioe) { ErrorManager.getDefault ().notify (ErrorManager.INFORMATIONAL, ioe); return null; @@ -1382,6 +1383,19 @@ TomcatInstallUtil.patchBundledServerXml(new File(baseDir, "conf/server.xml")); // NOI18N } return baseDir; + } + + /** + * Create a file and fill it with the data. + */ + private void writeToFile(File file, String data) throws IOException { + BufferedWriter bw = null; + try { + bw = new BufferedWriter(new FileWriter(file)); + bw.write(data); + } finally { + if (bw != null) bw.close(); + } } /** Copies server.xml file and patches appBase="webapps" to