1 | <!doctype html public "-//w3c/dtd HTML 4.0//en"> |
2 | <html><head><title>JSP update</title></head> |
3 | <body bgcolor="#FFFFFF"><font face="Helvetica"> |
4 | <%@ page import="java.util.*,JSPservletPkg.*" |
5 | session="false"%> |
6 | <h2><font color=#DB1260>JSP update</font></h2> |
7 | <form method="get" name="JSPupdate" |
8 | action="JSPupdate"> |
9 | <table border=0 cellspacing=2 cellpadding=2 |
10 | width=80%> |
11 | <tr><td width=30%><font face="Helvetica"> |
12 | <b>JAR Name :</b></td> |
13 | <td><font face="Helvetica"> |
14 | <input type="text" name="jarName" size=30> |
15 | </font></td></tr> |
16 | <tr><td width=30%><font face="Helvetica"> |
17 | <b>Remote Location :</b></td> |
18 | <td><font face="Helvetica"> |
19 | <input type="text" name="remoteLocation" |
20 | size=30></font></td></tr> |
21 | <tr><td><font face="Helvetica"> |
22 | <input type="Submit" value="JSPupdate" |
23 | name="Submit"></td></tr> |
24 | </table></form><hr width=80%> |
25 | <% |
26 | if ("GET".equals(request.getMethod())) { |
27 | String jarName = request.getParameter( |
28 | "jarName"); |
29 | if (jarName != null || !jarName.equals("")){ |
30 | String withoutExt = jarName; |
31 | int index = jarName.lastIndexOf('.'); |
32 | if (index != -1) |
33 | withoutExt = jarName.substring(0,index); |
34 | String contextPath = |
35 | request.getContextPath(); |
36 | if ((JSPservlet.JSPhandlers == null) || |
37 | (!JSPservlet.JSPhandlers.containsKey( |
38 | contextPath))) { |
39 | RequestDispatcher rd = |
40 | getServletContext().getRequestDispatcher( |
41 | "/JSPservlet"); |
42 | rd.include(request, response); |
43 | %> |
44 | <p><font face="Helvetica" color=#DB1260><i> |
45 | JAR <%= withoutExt %>handler created!</i> |
46 | </font></p> |
47 | <% |
48 | } else { |
49 | JSPhandler handler = (JSPhandler) |
50 | JSPservlet.JSPhandlers.get(contextPath); |
51 | if (!handler.update(withoutExt, |
52 | request.getParameter("remoteLocation"))){ |
53 | %> |
54 | <p><font face="Helvetica" color=#DB1260><i> |
55 | JAR <%= withoutExt %>JAR loaded!</i></font></p> |
56 | <% |
57 | } else { |
58 | %> |
59 | <p><font face="Helvetica" color=#DB1260><i> |
60 | JAR updated!</i></font></p> |
61 | <% |
62 | } |
63 | } |
64 | } |
65 | } |
66 | %> |