KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > manager > HTMLManagerServlet


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18
19 package org.apache.catalina.manager;
20
21 import java.io.File JavaDoc;
22 import java.io.IOException JavaDoc;
23 import java.io.PrintWriter JavaDoc;
24 import java.io.StringWriter JavaDoc;
25 import java.text.MessageFormat JavaDoc;
26 import java.util.Iterator JavaDoc;
27 import java.util.List JavaDoc;
28 import java.util.Map JavaDoc;
29 import java.util.TreeMap JavaDoc;
30 import javax.servlet.ServletException JavaDoc;
31 import javax.servlet.http.HttpServletRequest JavaDoc;
32 import javax.servlet.http.HttpServletResponse JavaDoc;
33
34 import org.apache.catalina.Container;
35 import org.apache.catalina.Context;
36 import org.apache.catalina.util.RequestUtil;
37 import org.apache.catalina.util.ServerInfo;
38 import org.apache.tomcat.util.http.fileupload.DiskFileUpload;
39 import org.apache.tomcat.util.http.fileupload.FileItem;
40
41 /**
42 * Servlet that enables remote management of the web applications deployed
43 * within the same virtual host as this web application is. Normally, this
44 * functionality will be protected by a security constraint in the web
45 * application deployment descriptor. However, this requirement can be
46 * relaxed during testing.
47 * <p>
48 * The difference between the <code>ManagerServlet</code> and this
49 * Servlet is that this Servlet prints out a HTML interface which
50 * makes it easier to administrate.
51 * <p>
52 * However if you use a software that parses the output of
53 * <code>ManagerServlet</code you won't be able to upgrade
54 * to this Servlet since the output are not in the
55 * same format ar from <code>ManagerServlet</code>
56 *
57 * @author Bip Thelin
58 * @author Malcolm Edgar
59 * @author Glenn L. Nielsen
60 * @version $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
61 * @see ManagerServlet
62 */

63
64 public final class HTMLManagerServlet extends ManagerServlet {
65
66     // --------------------------------------------------------- Public Methods
67

68     /**
69      * Process a GET request for the specified resource.
70      *
71      * @param request The servlet request we are processing
72      * @param response The servlet response we are creating
73      *
74      * @exception IOException if an input/output error occurs
75      * @exception ServletException if a servlet-specified error occurs
76      */

77     public void doGet(HttpServletRequest JavaDoc request,
78                       HttpServletResponse JavaDoc response)
79         throws IOException JavaDoc, ServletException JavaDoc {
80
81         // Identify the request parameters that we need
82
String JavaDoc command = request.getPathInfo();
83
84         String JavaDoc path = request.getParameter("path");
85         String JavaDoc deployPath = request.getParameter("deployPath");
86         String JavaDoc deployConfig = request.getParameter("deployConfig");
87         String JavaDoc deployWar = request.getParameter("deployWar");
88
89         // Prepare our output writer to generate the response message
90
response.setContentType("text/html; charset=" + Constants.CHARSET);
91
92         String JavaDoc message = "";
93         // Process the requested command
94
if (command == null || command.equals("/")) {
95         } else if (command.equals("/deploy")) {
96             message = deployInternal(deployConfig, deployPath, deployWar);
97         } else if (command.equals("/list")) {
98         } else if (command.equals("/reload")) {
99             message = reload(path);
100         } else if (command.equals("/undeploy")) {
101             message = undeploy(path);
102         } else if (command.equals("/sessions")) {
103             message = sessions(path);
104         } else if (command.equals("/start")) {
105             message = start(path);
106         } else if (command.equals("/stop")) {
107             message = stop(path);
108         } else {
109             message =
110                 sm.getString("managerServlet.unknownCommand",
111                              RequestUtil.filter(command));
112         }
113
114         list(request, response, message);
115     }
116
117     /**
118      * Process a POST request for the specified resource.
119      *
120      * @param request The servlet request we are processing
121      * @param response The servlet response we are creating
122      *
123      * @exception IOException if an input/output error occurs
124      * @exception ServletException if a servlet-specified error occurs
125      */

126     public void doPost(HttpServletRequest JavaDoc request,
127                       HttpServletResponse JavaDoc response)
128         throws IOException JavaDoc, ServletException JavaDoc {
129
130         // Identify the request parameters that we need
131
String JavaDoc command = request.getPathInfo();
132
133         if (command == null || !command.equals("/upload")) {
134             doGet(request,response);
135             return;
136         }
137
138         // Prepare our output writer to generate the response message
139
response.setContentType("text/html; charset=" + Constants.CHARSET);
140
141         String JavaDoc message = "";
142
143         // Create a new file upload handler
144
DiskFileUpload upload = new DiskFileUpload();
145
146         // Get the tempdir
147
File JavaDoc tempdir = (File JavaDoc) getServletContext().getAttribute
148             ("javax.servlet.context.tempdir");
149         // Set upload parameters
150
upload.setSizeMax(-1);
151         upload.setRepositoryPath(tempdir.getCanonicalPath());
152     
153         // Parse the request
154
String JavaDoc basename = null;
155         String JavaDoc war = null;
156         FileItem warUpload = null;
157         try {
158             List JavaDoc items = upload.parseRequest(request);
159         
160             // Process the uploaded fields
161
Iterator JavaDoc iter = items.iterator();
162             while (iter.hasNext()) {
163                 FileItem item = (FileItem) iter.next();
164         
165                 if (!item.isFormField()) {
166                     if (item.getFieldName().equals("deployWar") &&
167                         warUpload == null) {
168                         warUpload = item;
169                     } else {
170                         item.delete();
171                     }
172                 }
173             }
174             while (true) {
175                 if (warUpload == null) {
176                     message = sm.getString
177                         ("htmlManagerServlet.deployUploadNoFile");
178                     break;
179                 }
180                 war = warUpload.getName();
181                 if (!war.toLowerCase().endsWith(".war")) {
182                     message = sm.getString
183                         ("htmlManagerServlet.deployUploadNotWar",war);
184                     break;
185                 }
186                 // Get the filename if uploaded name includes a path
187
if (war.lastIndexOf('\\') >= 0) {
188                     war = war.substring(war.lastIndexOf('\\') + 1);
189                 }
190                 if (war.lastIndexOf('/') >= 0) {
191                     war = war.substring(war.lastIndexOf('/') + 1);
192                 }
193                 // Identify the appBase of the owning Host of this Context
194
// (if any)
195
basename = war.substring(0, war.toLowerCase().indexOf(".war"));
196                 File JavaDoc file = new File JavaDoc(getAppBase(), war);
197                 if (file.exists()) {
198                     message = sm.getString
199                         ("htmlManagerServlet.deployUploadWarExists",war);
200                     break;
201                 }
202                 String JavaDoc path = null;
203                 if (basename.equals("ROOT")) {
204                     path = "";
205                 } else {
206                     path = "/" + basename;
207                 }
208
209                 if (!isServiced(path)) {
210                     addServiced(path);
211                     try {
212                         warUpload.write(file);
213                         // Perform new deployment
214
check(path);
215                     } finally {
216                         removeServiced(path);
217                     }
218                 }
219                 break;
220             }
221         } catch(Exception JavaDoc e) {
222             message = sm.getString
223                 ("htmlManagerServlet.deployUploadFail", e.getMessage());
224             log(message, e);
225         } finally {
226             if (warUpload != null) {
227                 warUpload.delete();
228             }
229             warUpload = null;
230         }
231
232         list(request, response, message);
233     }
234
235     /**
236      * Deploy an application for the specified path from the specified
237      * web application archive.
238      *
239      * @param config URL of the context configuration file to be deployed
240      * @param path Context path of the application to be deployed
241      * @param war URL of the web application archive to be deployed
242      * @return message String
243      */

244     protected String JavaDoc deployInternal(String JavaDoc config, String JavaDoc path, String JavaDoc war) {
245
246         StringWriter JavaDoc stringWriter = new StringWriter JavaDoc();
247         PrintWriter JavaDoc printWriter = new PrintWriter JavaDoc(stringWriter);
248
249         super.deploy(printWriter, config, path, war, false);
250
251         return stringWriter.toString();
252     }
253
254     /**
255      * Render a HTML list of the currently active Contexts in our virtual host,
256      * and memory and server status information.
257      *
258      * @param request The request
259      * @param response The response
260      * @param message a message to display
261      */

262     public void list(HttpServletRequest JavaDoc request,
263                      HttpServletResponse JavaDoc response,
264                      String JavaDoc message) throws IOException JavaDoc {
265
266         if (debug >= 1)
267             log("list: Listing contexts for virtual host '" +
268                 host.getName() + "'");
269
270         PrintWriter JavaDoc writer = response.getWriter();
271
272         // HTML Header Section
273
writer.print(Constants.HTML_HEADER_SECTION);
274
275         // Body Header Section
276
Object JavaDoc[] args = new Object JavaDoc[2];
277         args[0] = request.getContextPath();
278         args[1] = sm.getString("htmlManagerServlet.title");
279         writer.print(MessageFormat.format
280                      (Constants.BODY_HEADER_SECTION, args));
281
282         // Message Section
283
args = new Object JavaDoc[3];
284         args[0] = sm.getString("htmlManagerServlet.messageLabel");
285         args[1] = (message == null || message.length() == 0) ? "OK" : message;
286         writer.print(MessageFormat.format(Constants.MESSAGE_SECTION, args));
287
288         // Manager Section
289
args = new Object JavaDoc[9];
290         args[0] = sm.getString("htmlManagerServlet.manager");
291         args[1] = response.encodeURL(request.getContextPath() + "/html/list");
292         args[2] = sm.getString("htmlManagerServlet.list");
293         args[3] = response.encodeURL
294             (request.getContextPath() + "/" +
295              sm.getString("htmlManagerServlet.helpHtmlManagerFile"));
296         args[4] = sm.getString("htmlManagerServlet.helpHtmlManager");
297         args[5] = response.encodeURL
298             (request.getContextPath() + "/" +
299              sm.getString("htmlManagerServlet.helpManagerFile"));
300         args[6] = sm.getString("htmlManagerServlet.helpManager");
301         args[7] = response.encodeURL
302             (request.getContextPath() + "/status");
303         args[8] = sm.getString("statusServlet.title");
304         writer.print(MessageFormat.format(Constants.MANAGER_SECTION, args));
305
306         // Apps Header Section
307
args = new Object JavaDoc[6];
308         args[0] = sm.getString("htmlManagerServlet.appsTitle");
309         args[1] = sm.getString("htmlManagerServlet.appsPath");
310         args[2] = sm.getString("htmlManagerServlet.appsName");
311         args[3] = sm.getString("htmlManagerServlet.appsAvailable");
312         args[4] = sm.getString("htmlManagerServlet.appsSessions");
313         args[5] = sm.getString("htmlManagerServlet.appsTasks");
314         writer.print(MessageFormat.format(APPS_HEADER_SECTION, args));
315
316         // Apps Row Section
317
// Create sorted map of deployed applications context paths.
318
Container children[] = host.findChildren();
319         String JavaDoc contextPaths[] = new String JavaDoc[children.length];
320         for (int i = 0; i < children.length; i++)
321             contextPaths[i] = children[i].getName();
322
323         TreeMap JavaDoc sortedContextPathsMap = new TreeMap JavaDoc();
324
325         for (int i = 0; i < contextPaths.length; i++) {
326             String JavaDoc displayPath = contextPaths[i];
327             sortedContextPathsMap.put(displayPath, contextPaths[i]);
328         }
329
330         String JavaDoc appsStart = sm.getString("htmlManagerServlet.appsStart");
331         String JavaDoc appsStop = sm.getString("htmlManagerServlet.appsStop");
332         String JavaDoc appsReload = sm.getString("htmlManagerServlet.appsReload");
333         String JavaDoc appsUndeploy = sm.getString("htmlManagerServlet.appsUndeploy");
334
335         Iterator JavaDoc iterator = sortedContextPathsMap.entrySet().iterator();
336         boolean isHighlighted = true;
337         boolean isDeployed = true;
338         String JavaDoc highlightColor = null;
339
340         while (iterator.hasNext()) {
341             // Bugzilla 34818, alternating row colors
342
isHighlighted = !isHighlighted;
343             if(isHighlighted) {
344                 highlightColor = "#C3F3C3";
345             } else {
346                 highlightColor = "#FFFFFF";
347             }
348
349             Map.Entry JavaDoc entry = (Map.Entry JavaDoc) iterator.next();
350             String JavaDoc displayPath = (String JavaDoc) entry.getKey();
351             String JavaDoc contextPath = (String JavaDoc) entry.getKey();
352             Context context = (Context) host.findChild(contextPath);
353             if (displayPath.equals("")) {
354                 displayPath = "/";
355             }
356
357             if (context != null ) {
358                 try {
359                     isDeployed = isDeployed(contextPath);
360                 } catch (Exception JavaDoc e) {
361                     // Assume false on failure for safety
362
isDeployed = false;
363                 }
364                 
365                 args = new Object JavaDoc[6];
366                 args[0] = displayPath;
367                 args[1] = context.getDisplayName();
368                 if (args[1] == null) {
369                     args[1] = "&nbsp;";
370                 }
371                 args[2] = new Boolean JavaDoc(context.getAvailable());
372                 args[3] = response.encodeURL
373                     (request.getContextPath() +
374                      "/html/sessions?path=" + displayPath);
375                 if (context.getManager() != null) {
376                     args[4] = new Integer JavaDoc
377                         (context.getManager().getActiveSessions());
378                 } else {
379                     args[4] = new Integer JavaDoc(0);
380                 }
381
382                 args[5] = highlightColor;
383
384                 writer.print
385                     (MessageFormat.format(APPS_ROW_DETAILS_SECTION, args));
386
387                 args = new Object JavaDoc[9];
388                 args[0] = response.encodeURL
389                     (request.getContextPath() +
390                      "/html/start?path=" + displayPath);
391                 args[1] = appsStart;
392                 args[2] = response.encodeURL
393                     (request.getContextPath() +
394                      "/html/stop?path=" + displayPath);
395                 args[3] = appsStop;
396                 args[4] = response.encodeURL
397                     (request.getContextPath() +
398                      "/html/reload?path=" + displayPath);
399                 args[5] = appsReload;
400                 args[6] = response.encodeURL
401                     (request.getContextPath() +
402                      "/html/undeploy?path=" + displayPath);
403                 args[7] = appsUndeploy;
404                 
405                 args[8] = highlightColor;
406
407                 if (context.getPath().equals(this.context.getPath())) {
408                     writer.print(MessageFormat.format(
409                         MANAGER_APP_ROW_BUTTON_SECTION, args));
410                 } else if (context.getAvailable() && isDeployed) {
411                     writer.print(MessageFormat.format(
412                         STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION, args));
413                 } else if (context.getAvailable() && !isDeployed) {
414                     writer.print(MessageFormat.format(
415                         STARTED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION, args));
416                 } else if (!context.getAvailable() && isDeployed) {
417                     writer.print(MessageFormat.format(
418                         STOPPED_DEPLOYED_APPS_ROW_BUTTON_SECTION, args));
419                 } else {
420                     writer.print(MessageFormat.format(
421                         STOPPED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION, args));
422                 }
423
424             }
425         }
426
427         // Deploy Section
428
args = new Object JavaDoc[7];
429         args[0] = sm.getString("htmlManagerServlet.deployTitle");
430         args[1] = sm.getString("htmlManagerServlet.deployServer");
431         args[2] = response.encodeURL(request.getContextPath() + "/html/deploy");
432         args[3] = sm.getString("htmlManagerServlet.deployPath");
433         args[4] = sm.getString("htmlManagerServlet.deployConfig");
434         args[5] = sm.getString("htmlManagerServlet.deployWar");
435         args[6] = sm.getString("htmlManagerServlet.deployButton");
436         writer.print(MessageFormat.format(DEPLOY_SECTION, args));
437
438         args = new Object JavaDoc[4];
439         args[0] = sm.getString("htmlManagerServlet.deployUpload");
440         args[1] = response.encodeURL(request.getContextPath() + "/html/upload");
441         args[2] = sm.getString("htmlManagerServlet.deployUploadFile");
442         args[3] = sm.getString("htmlManagerServlet.deployButton");
443         writer.print(MessageFormat.format(UPLOAD_SECTION, args));
444
445         // Server Header Section
446
args = new Object JavaDoc[7];
447         args[0] = sm.getString("htmlManagerServlet.serverTitle");
448         args[1] = sm.getString("htmlManagerServlet.serverVersion");
449         args[2] = sm.getString("htmlManagerServlet.serverJVMVersion");
450         args[3] = sm.getString("htmlManagerServlet.serverJVMVendor");
451         args[4] = sm.getString("htmlManagerServlet.serverOSName");
452         args[5] = sm.getString("htmlManagerServlet.serverOSVersion");
453         args[6] = sm.getString("htmlManagerServlet.serverOSArch");
454         writer.print(MessageFormat.format
455                      (Constants.SERVER_HEADER_SECTION, args));
456
457         // Server Row Section
458
args = new Object JavaDoc[6];
459         args[0] = ServerInfo.getServerInfo();
460         args[1] = System.getProperty("java.runtime.version");
461         args[2] = System.getProperty("java.vm.vendor");
462         args[3] = System.getProperty("os.name");
463         args[4] = System.getProperty("os.version");
464         args[5] = System.getProperty("os.arch");
465         writer.print(MessageFormat.format(Constants.SERVER_ROW_SECTION, args));
466
467         // HTML Tail Section
468
writer.print(Constants.HTML_TAIL_SECTION);
469
470         // Finish up the response
471
writer.flush();
472         writer.close();
473     }
474
475     /**
476      * Reload the web application at the specified context path.
477      *
478      * @see ManagerServlet#reload(PrintWriter, String)
479      *
480      * @param path Context path of the application to be restarted
481      * @return message String
482      */

483     protected String JavaDoc reload(String JavaDoc path) {
484
485         StringWriter JavaDoc stringWriter = new StringWriter JavaDoc();
486         PrintWriter JavaDoc printWriter = new PrintWriter JavaDoc(stringWriter);
487
488         super.reload(printWriter, path);
489
490         return stringWriter.toString();
491     }
492
493     /**
494      * Undeploy the web application at the specified context path.
495      *
496      * @see ManagerServlet#undeploy(PrintWriter, String)
497      *
498      * @param path Context path of the application to be undeployd
499      * @return message String
500      */

501     protected String JavaDoc undeploy(String JavaDoc path) {
502
503         StringWriter JavaDoc stringWriter = new StringWriter JavaDoc();
504         PrintWriter JavaDoc printWriter = new PrintWriter JavaDoc(stringWriter);
505
506         super.undeploy(printWriter, path);
507
508         return stringWriter.toString();
509     }
510
511     /**
512      * Display session information and invoke list.
513      *
514      * @see ManagerServlet#sessions(PrintWriter, String)
515      *
516      * @param path Context path of the application to list session information
517      * @return message String
518      */

519     public String JavaDoc sessions(String JavaDoc path) {
520
521         StringWriter JavaDoc stringWriter = new StringWriter JavaDoc();
522         PrintWriter JavaDoc printWriter = new PrintWriter JavaDoc(stringWriter);
523
524         super.sessions(printWriter, path);
525
526         return stringWriter.toString();
527     }
528
529     /**
530      * Start the web application at the specified context path.
531      *
532      * @see ManagerServlet#start(PrintWriter, String)
533      *
534      * @param path Context path of the application to be started
535      * @return message String
536      */

537     public String JavaDoc start(String JavaDoc path) {
538
539         StringWriter JavaDoc stringWriter = new StringWriter JavaDoc();
540         PrintWriter JavaDoc printWriter = new PrintWriter JavaDoc(stringWriter);
541
542         super.start(printWriter, path);
543
544         return stringWriter.toString();
545     }
546
547     /**
548      * Stop the web application at the specified context path.
549      *
550      * @see ManagerServlet#stop(PrintWriter, String)
551      *
552      * @param path Context path of the application to be stopped
553      * @return message String
554      */

555     protected String JavaDoc stop(String JavaDoc path) {
556
557         StringWriter JavaDoc stringWriter = new StringWriter JavaDoc();
558         PrintWriter JavaDoc printWriter = new PrintWriter JavaDoc(stringWriter);
559
560         super.stop(printWriter, path);
561
562         return stringWriter.toString();
563     }
564
565     // ------------------------------------------------------ Private Constants
566

567     // These HTML sections are broken in relatively small sections, because of
568
// limited number of subsitutions MessageFormat can process
569
// (maximium of 10).
570

571     private static final String JavaDoc APPS_HEADER_SECTION =
572         "<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n" +
573         "<tr>\n" +
574         " <td colspan=\"5\" class=\"title\">{0}</td>\n" +
575         "</tr>\n" +
576         "<tr>\n" +
577         " <td class=\"header-left\"><small>{1}</small></td>\n" +
578         " <td class=\"header-left\"><small>{2}</small></td>\n" +
579         " <td class=\"header-center\"><small>{3}</small></td>\n" +
580         " <td class=\"header-center\"><small>{4}</small></td>\n" +
581         " <td class=\"header-center\"><small>{5}</small></td>\n" +
582         "</tr>\n";
583
584     private static final String JavaDoc APPS_ROW_DETAILS_SECTION =
585         "<tr>\n" +
586         " <td class=\"row-left\" bgcolor=\"{5}\"><small><a HREF=\"{0}\">{0}</a></small></td>\n" +
587         " <td class=\"row-left\" bgcolor=\"{5}\"><small>{1}</small></td>\n" +
588         " <td class=\"row-center\" bgcolor=\"{5}\"><small>{2}</small></td>\n" +
589         " <td class=\"row-center\" bgcolor=\"{5}\"><small><a HREF=\"{3}\">{4}</a></small></td>\n";
590
591     private static final String JavaDoc MANAGER_APP_ROW_BUTTON_SECTION =
592         " <td class=\"row-left\" bgcolor=\"{8}\">\n" +
593         " <small>\n" +
594         " &nbsp;{1}&nbsp;\n" +
595         " &nbsp;{3}&nbsp;\n" +
596         " &nbsp;{5}&nbsp;\n" +
597         " &nbsp;{7}&nbsp;\n" +
598         " </small>\n" +
599         " </td>\n" +
600         "</tr>\n";
601
602     private static final String JavaDoc STARTED_DEPLOYED_APPS_ROW_BUTTON_SECTION =
603         " <td class=\"row-left\" bgcolor=\"{8}\">\n" +
604         " <small>\n" +
605         " &nbsp;{1}&nbsp;\n" +
606         " &nbsp;<a HREF=\"{2}\" onclick=\"return(confirm('''Are you sure?'''))\">{3}</a>&nbsp;\n" +
607         " &nbsp;<a HREF=\"{4}\" onclick=\"return(confirm('''Are you sure?'''))\">{5}</a>&nbsp;\n" +
608         " &nbsp;<a HREF=\"{6}\" onclick=\"return(confirm('''Are you sure?'''))\">{7}</a>&nbsp;\n" +
609         " </small>\n" +
610         " </td>\n" +
611         "</tr>\n";
612
613     private static final String JavaDoc STOPPED_DEPLOYED_APPS_ROW_BUTTON_SECTION =
614         " <td class=\"row-left\" bgcolor=\"{8}\">\n" +
615         " <small>\n" +
616         " &nbsp;<a HREF=\"{0}\" onclick=\"return(confirm('''Are you sure?'''))\">{1}</a>&nbsp;\n" +
617         " &nbsp;{3}&nbsp;\n" +
618         " &nbsp;{5}&nbsp;\n" +
619         " &nbsp;<a HREF=\"{6}\" onclick=\"return(confirm('''Are you sure? This will delete the application.'''))\">{7}</a>&nbsp;\n" +
620         " </small>\n" +
621         " </td>\n" +
622         "</tr>\n";
623
624     private static final String JavaDoc STARTED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION =
625         " <td class=\"row-left\" bgcolor=\"{8}\">\n" +
626         " <small>\n" +
627         " &nbsp;{1}&nbsp;\n" +
628         " &nbsp;<a HREF=\"{2}\" onclick=\"return(confirm('''Are you sure?'''))\">{3}</a>&nbsp;\n" +
629         " &nbsp;<a HREF=\"{4}\" onclick=\"return(confirm('''Are you sure?'''))\">{5}</a>&nbsp;\n" +
630         " &nbsp;{7}&nbsp;\n" +
631         " </small>\n" +
632         " </td>\n" +
633         "</tr>\n";
634
635     private static final String JavaDoc STOPPED_NONDEPLOYED_APPS_ROW_BUTTON_SECTION =
636         " <td class=\"row-left\" bgcolor=\"{8}\">\n" +
637         " <small>\n" +
638         " &nbsp;<a HREF=\"{0}\" onclick=\"return(confirm('''Are you sure?'''))\">{1}</a>&nbsp;\n" +
639         " &nbsp;{3}&nbsp;\n" +
640         " &nbsp;{5}&nbsp;\n" +
641         " &nbsp;{7}&nbsp;\n" +
642         " </small>\n" +
643         " </td>\n" +
644         "</tr>\n";
645
646     private static final String JavaDoc DEPLOY_SECTION =
647         "</table>\n" +
648         "<br>\n" +
649         "<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\">\n" +
650         "<tr>\n" +
651         " <td colspan=\"2\" class=\"title\">{0}</td>\n" +
652         "</tr>\n" +
653         "<tr>\n" +
654         " <td colspan=\"2\" class=\"header-left\"><small>{1}</small></td>\n" +
655         "</tr>\n" +
656         "<tr>\n" +
657         " <td colspan=\"2\">\n" +
658         "<form method=\"get\" action=\"{2}\">\n" +
659         "<table cellspacing=\"0\" cellpadding=\"3\">\n" +
660         "<tr>\n" +
661         " <td class=\"row-right\">\n" +
662         " <small>{3}</small>\n" +
663         " </td>\n" +
664         " <td class=\"row-left\">\n" +
665         " <input type=\"text\" name=\"deployPath\" size=\"20\">\n" +
666         " </td>\n" +
667         "</tr>\n" +
668         "<tr>\n" +
669         " <td class=\"row-right\">\n" +
670         " <small>{4}</small>\n" +
671         " </td>\n" +
672         " <td class=\"row-left\">\n" +
673         " <input type=\"text\" name=\"deployConfig\" size=\"20\">\n" +
674         " </td>\n" +
675         "</tr>\n" +
676         "<tr>\n" +
677         " <td class=\"row-right\">\n" +
678         " <small>{5}</small>\n" +
679         " </td>\n" +
680         " <td class=\"row-left\">\n" +
681         " <input type=\"text\" name=\"deployWar\" size=\"40\">\n" +
682         " </td>\n" +
683         "</tr>\n" +
684         "<tr>\n" +
685         " <td class=\"row-right\">\n" +
686         " &nbsp;\n" +
687         " </td>\n" +
688         " <td class=\"row-left\">\n" +
689         " <input type=\"submit\" value=\"{6}\">\n" +
690         " </td>\n" +
691         "</tr>\n" +
692         "</table>\n" +
693         "</form>\n" +
694         "</td>\n" +
695         "</tr>\n";
696
697     private static final String JavaDoc UPLOAD_SECTION =
698         "<tr>\n" +
699         " <td colspan=\"2\" class=\"header-left\"><small>{0}</small></td>\n" +
700         "</tr>\n" +
701         "<tr>\n" +
702         " <td colspan=\"2\">\n" +
703         "<form action=\"{1}\" method=\"post\" " +
704         "enctype=\"multipart/form-data\">\n" +
705         "<table cellspacing=\"0\" cellpadding=\"3\">\n" +
706         "<tr>\n" +
707         " <td class=\"row-right\">\n" +
708         " <small>{2}</small>\n" +
709         " </td>\n" +
710         " <td class=\"row-left\">\n" +
711         " <input type=\"file\" name=\"deployWar\" size=\"40\">\n" +
712         " </td>\n" +
713         "</tr>\n" +
714         "<tr>\n" +
715         " <td class=\"row-right\">\n" +
716         " &nbsp;\n" +
717         " </td>\n" +
718         " <td class=\"row-left\">\n" +
719         " <input type=\"submit\" value=\"{3}\">\n" +
720         " </td>\n" +
721         "</tr>\n" +
722         "</table>\n" +
723         "</form>\n" +
724         "</table>\n" +
725         "<br>\n" +
726         "\n";
727
728 }
729
Popular Tags