String command = request.getPathInfo();
String path = request.getParameter("path");
- String deployPath = request.getParameter("deployPath");
- String deployConfig = request.getParameter("deployConfig");
- String deployWar = request.getParameter("deployWar");
// Prepare our output writer to generate the response message
response.setContentType("text/html; charset=" + Constants.CHARSET);
// Process the requested command
if (command == null || command.equals("/")) {
// No command == list
- } else if (command.equals("/deploy")) {
- message = deployInternal(deployConfig, deployPath, deployWar);
} else if (command.equals("/list")) {
// List always displayed - nothing to do here
- } else if (command.equals("/reload")) {
- message = reload(path);
- } else if (command.equals("/undeploy")) {
- message = undeploy(path);
- } else if (command.equals("/expire")) {
- message = expireSessions(path, request);
} else if (command.equals("/sessions")) {
try {
doSessions(path, request, response);
message = sm.getString("managerServlet.exception",
e.toString());
}
- } else if (command.equals("/start")) {
- message = start(path);
- } else if (command.equals("/stop")) {
- message = stop(path);
+ } else if (command.equals("/upload") || command.equals("/deploy") ||
+ command.equals("/reload") || command.equals("/undeploy") ||
+ command.equals("/expire") || command.equals("/start") ||
+ command.equals("/stop")) {
+ message =
+ sm.getString("managerServlet.postCommand", command);
} else {
message =
sm.getString("managerServlet.unknownCommand", command);
// be configured in web.xml
String command = request.getPathInfo();
- if (command == null || !command.equals("/upload")) {
- doGet(request,response);
- return;
- }
+ String path = request.getParameter("path");
+ String deployPath = request.getParameter("deployPath");
+ String deployConfig = request.getParameter("deployConfig");
+ String deployWar = request.getParameter("deployWar");
// Prepare our output writer to generate the response message
response.setContentType("text/html; charset=" + Constants.CHARSET);
- String message = upload(request);
+ String message = "";
+
+ if (command == null || command.length() == 0) {
+ // No command == list
+ // List always displayed -> do nothing
+ } else if (command.equals("/upload")) {
+ message = upload(request);
+ } else if (command.equals("/deploy")) {
+ message = deployInternal(deployConfig, deployPath, deployWar);
+ } else if (command.equals("/reload")) {
+ message = reload(path);
+ } else if (command.equals("/undeploy")) {
+ message = undeploy(path);
+ } else if (command.equals("/expire")) {
+ message = expireSessions(path, request);
+ } else if (command.equals("/start")) {
+ message = start(path);
+ } else if (command.equals("/stop")) {
+ message = stop(path);
+ } else {
+ // Try GET
+ doGet(request,response);
+ return;
+ }
list(request, response, message);
}
private static final String STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION =
" <td class=\"row-left\" bgcolor=\"{13}\">\n" +
- " <small>\n" +
- " {1} \n" +
- " <a href=\"{2}\" onclick=\"return(confirm('''Are you sure?'''))\">{3}</a> \n" +
- " <a href=\"{4}\" onclick=\"return(confirm('''Are you sure?'''))\">{5}</a> \n" +
- " <a href=\"{6}\" onclick=\"return(confirm('''Are you sure?'''))\">{7}</a> \n" +
- " </small>\n" +
+ " <small>{1}</small> \n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{2}\"><small><input type=\"submit\" value=\"{3}\"></small></form>\n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{4}\"><small><input type=\"submit\" value=\"{5}\"></small></form>\n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{6}\"><small><input type=\"submit\" value=\"{7}\"></small></form>\n" +
" </td>\n" +
" </tr><tr>\n" +
" <td class=\"row-left\" bgcolor=\"{13}\">\n" +
private static final String STOPPED_DEPLOYED_APPS_ROW_BUTTON_SECTION =
" <td class=\"row-left\" bgcolor=\"{13}\" rowspan=\"2\">\n" +
- " <small>\n" +
- " <a href=\"{0}\" onclick=\"return(confirm('''Are you sure?'''))\">{1}</a> \n" +
- " {3} \n" +
- " {5} \n" +
- " <a href=\"{6}\" onclick=\"return(confirm('''Are you sure? This will delete the application.'''))\">{7}</a> \n" +
- " </small>\n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{0}\"><small><input type=\"submit\" value=\"{1}\"></small></form>\n" +
+ " <small>{3}</small> \n" +
+ " <small>{5}</small> \n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{6}\"><small><input type=\"submit\" value=\"{7}\"></small></form>\n" +
" </td>\n" +
"</tr>\n<tr></tr>\n";
private static final String STARTED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION =
" <td class=\"row-left\" bgcolor=\"{13}\" rowspan=\"2\">\n" +
- " <small>\n" +
- " {1} \n" +
- " <a href=\"{2}\" onclick=\"return(confirm('''Are you sure?'''))\">{3}</a> \n" +
- " <a href=\"{4}\" onclick=\"return(confirm('''Are you sure?'''))\">{5}</a> \n" +
- " {7} \n" +
- " </small>\n" +
+ " <small>{1}</small> \n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{2}\"><small><input type=\"submit\" value=\"{3}\"></small></form>\n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{4}\"><small><input type=\"submit\" value=\"{5}\"></small></form>\n" +
+ " <small>{7}</small> \n" +
" </td>\n" +
"</tr>\n<tr></tr>\n";
private static final String STOPPED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION =
" <td class=\"row-left\" bgcolor=\"{13}\" rowspan=\"2\">\n" +
- " <small>\n" +
- " <a href=\"{0}\" onclick=\"return(confirm('''Are you sure?'''))\">{1}</a> \n" +
- " {3} \n" +
- " {5} \n" +
- " {7} \n" +
- " </small>\n" +
+ " <form class=\"inline\" method=\"POST\" action=\"{0}\"><small><input type=\"submit\" value=\"{1}\"></small></form>\n" +
+ " <small>{3}</small> \n" +
+ " <small>{5}</small> \n" +
+ " <small>{7}</small> \n" +
" </td>\n" +
"</tr>\n<tr></tr>\n";