You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2006/10/24 10:48:08 UTC
svn commit: r467278 - in /webservices/axis2/branches/java/1_1/modules:
kernel/src/org/apache/axis2/transport/http/AdminAgent.java webapp/upload.jsp
Author: chamil
Date: Tue Oct 24 01:48:06 2006
New Revision: 467278
URL: http://svn.apache.org/viewvc?view=rev&rev=467278
Log:
Added code to show the status of Hot Update and Hot Deployment. [Ref: JIRA AXIS2-1427]. Reformatted the method code to 100chars width.
Modified:
webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java
webservices/axis2/branches/java/1_1/modules/webapp/upload.jsp
Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java?view=diff&rev=467278&r1=467277&r2=467278
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java (original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/AdminAgent.java Tue Oct 24 01:48:06 2006
@@ -111,55 +111,63 @@
// supported web operations
- protected void processUpload(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
-
- boolean isMultipart = FileUpload.isMultipartContent(req);
- if (isMultipart) {
-
- try {
- // Create a new file upload handler
- DiskFileUpload upload = new DiskFileUpload();
-
- List items = upload.parseRequest(req);
-
- // Process the uploaded items
- Iterator iter = items.iterator();
- while (iter.hasNext()) {
- FileItem item = (FileItem) iter.next();
-
- if (!item.isFormField()) {
-
- String fileName = item.getName();
- String fileExtesion = fileName;
- fileExtesion = fileExtesion.toLowerCase();
- if (!(fileExtesion.endsWith(".jar") || fileExtesion.endsWith(".aar"))) {
- req.setAttribute("status", "failure");
- req.setAttribute("cause", "Unsupported file type " + fileExtesion);
- } else {
-
- String fileNameOnly = "";
- if (fileName.indexOf("\\") < 0) {
- fileNameOnly = fileName.substring(fileName.lastIndexOf("/") + 1, fileName.length());
- } else {
- fileNameOnly = fileName.substring(fileName.lastIndexOf("\\") + 1, fileName.length());
- }
-
-
- File uploadedFile = new File(serviceDir, fileNameOnly);
- item.write(uploadedFile);
- req.setAttribute("status", "success");
- req.setAttribute("filename", fileNameOnly);
- }
- }
- }
- } catch (Exception e) {
- req.setAttribute("status", "failure");
- req.setAttribute("cause", e.getMessage());
-
- }
- }
-
- renderView("upload.jsp", req, res);
+ protected void processUpload(HttpServletRequest req, HttpServletResponse res)
+ throws IOException, ServletException {
+ String hasHotDeployment =
+ (String) configContext.getAxisConfiguration().getParameterValue("hotdeployment");
+ String hasHotUpdate =
+ (String) configContext.getAxisConfiguration().getParameterValue("hotupdate");
+ req.setAttribute("hotDeployment", (hasHotDeployment.equals("true")) ? "enabled"
+ : "disabled");
+ req.setAttribute("hotUpdate", (hasHotUpdate.equals("true")) ? "enabled" : "disabled");
+ boolean isMultipart = FileUpload.isMultipartContent(req);
+ if (isMultipart) {
+
+ try {
+ // Create a new file upload handler
+ DiskFileUpload upload = new DiskFileUpload();
+
+ List items = upload.parseRequest(req);
+
+ // Process the uploaded items
+ Iterator iter = items.iterator();
+ while (iter.hasNext()) {
+ FileItem item = (FileItem) iter.next();
+ if (!item.isFormField()) {
+
+ String fileName = item.getName();
+ String fileExtesion = fileName;
+ fileExtesion = fileExtesion.toLowerCase();
+ if (!(fileExtesion.endsWith(".jar") || fileExtesion.endsWith(".aar"))) {
+ req.setAttribute("status", "failure");
+ req.setAttribute("cause", "Unsupported file type " + fileExtesion);
+ } else {
+
+ String fileNameOnly = "";
+ if (fileName.indexOf("\\") < 0) {
+ fileNameOnly =
+ fileName.substring(fileName.lastIndexOf("/") + 1, fileName
+ .length());
+ } else {
+ fileNameOnly =
+ fileName.substring(fileName.lastIndexOf("\\") + 1, fileName
+ .length());
+ }
+
+ File uploadedFile = new File(serviceDir, fileNameOnly);
+ item.write(uploadedFile);
+ req.setAttribute("status", "success");
+ req.setAttribute("filename", fileNameOnly);
+ }
+ }
+ }
+ } catch (Exception e) {
+ req.setAttribute("status", "failure");
+ req.setAttribute("cause", e.getMessage());
+
+ }
+ }
+ renderView("upload.jsp", req, res);
}
Modified: webservices/axis2/branches/java/1_1/modules/webapp/upload.jsp
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/webapp/upload.jsp?view=diff&rev=467278&r1=467277&r2=467278
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/webapp/upload.jsp (original)
+++ webservices/axis2/branches/java/1_1/modules/webapp/upload.jsp Tue Oct 24 01:48:06 2006
@@ -30,7 +30,7 @@
}
//-->
</script>
-<h2>Upload an Axis Service Archive File</h2>
+<h1>Upload an Axis Service Archive File</h1>
<p>You can upload a packaged Axis2 service from this page in two small steps.</p>
<ul>
@@ -59,5 +59,9 @@
<td><input name="upload" type="button" onclick="javascript:checkFileUpload();" value=" Upload "/></td>
</tr>
</table>
-</form>
+</form>
+<blockquote>
+<p>Hot deployment of new service archives is <%=request.getAttribute("hotDeployment") %></p>
+<p>Hot update of existing service archives is <%=request.getAttribute("hotUpdate") %></p>
+</blockquote>
<jsp:include page="include/adminfooter.jsp"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org