Start the web application at the specified context path. @param writer Writer to render to @param cn Name of the application to be started @param smClient i18n support for current client's locale
(PrintWriter writer, ContextName cn, StringManager smClient)
| 1341 | * @param smClient i18n support for current client's locale |
| 1342 | */ |
| 1343 | protected void start(PrintWriter writer, ContextName cn, StringManager smClient) { |
| 1344 | |
| 1345 | if (debug >= 1) { |
| 1346 | log("start: Starting web application '" + cn + "'"); |
| 1347 | } |
| 1348 | |
| 1349 | if (!validateContextName(cn, writer, smClient)) { |
| 1350 | return; |
| 1351 | } |
| 1352 | |
| 1353 | String displayPath = cn.getDisplayName(); |
| 1354 | |
| 1355 | try { |
| 1356 | Context context = (Context) host.findChild(cn.getName()); |
| 1357 | if (context == null) { |
| 1358 | writer.println(smClient.getString("managerServlet.noContext", Escape.htmlElementContent(displayPath))); |
| 1359 | return; |
| 1360 | } |
| 1361 | context.start(); |
| 1362 | if (context.getState().isAvailable()) { |
| 1363 | writer.println(smClient.getString("managerServlet.started", displayPath)); |
| 1364 | } else { |
| 1365 | writer.println(smClient.getString("managerServlet.startFailed", displayPath)); |
| 1366 | } |
| 1367 | } catch (Throwable t) { |
| 1368 | ExceptionUtils.handleThrowable(t); |
| 1369 | log(sm.getString("managerServlet.error.start", displayPath), t); |
| 1370 | writer.println(smClient.getString("managerServlet.startFailed", displayPath)); |
| 1371 | writer.println(smClient.getString("managerServlet.exception", t.toString())); |
| 1372 | } |
| 1373 | |
| 1374 | } |
| 1375 | |
| 1376 | |
| 1377 | /** |
no test coverage detected