Fix bug 43611. Provide an error message if user tries to upload a war for a context...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 1 Dec 2007 18:26:13 +0000 (18:26 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 1 Dec 2007 18:26:13 +0000 (18:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@600177 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/manager/HTMLManagerServlet.java
java/org/apache/catalina/manager/LocalStrings.properties

index 49afafe..b1d0300 100644 (file)
@@ -228,6 +228,12 @@ public final class HTMLManagerServlet extends ManagerServlet {
                     path = "/" + basename;
                 }
 
+                if ((host.findChild(path) != null) && !isDeployed(path)) {
+                    message = sm.getString
+                        ("htmlManagerServlet.deployUploadInServerXml", war);
+                    break;
+                }
+
                 if (!isServiced(path)) {
                     addServiced(path);
                     try {
index d220750..eae6fc6 100644 (file)
@@ -38,6 +38,7 @@ htmlManagerServlet.deployTitle=Deploy
 htmlManagerServlet.deployUpload=WAR file to deploy
 htmlManagerServlet.deployUploadFail=FAIL - Deploy Upload Failed, Exception: {0}
 htmlManagerServlet.deployUploadFile=Select WAR file to upload
+htmlManagerServlet.deployUploadInServerXml=FAIL - War file \"{0}\" cannot be uploaded if context is defined in server.xml 
 htmlManagerServlet.deployUploadNotWar=FAIL - File uploaded \"{0}\" must be a .war
 htmlManagerServlet.deployUploadNoFile=FAIL - File upload failed, no file
 htmlManagerServlet.deployUploadWarExists=FAIL - War file \"{0}\" already exists on server