From b4f999416533fafadfc71c175ce8242caab9e2d0 Mon Sep 17 00:00:00 2001 From: "Maria Odea B. Ching" Date: Fri, 30 May 2008 07:43:23 +0000 Subject: [PATCH] [MRM-785] -set success result to go to jsp file instead of redirect to 'upload' action -clear the form fields before returning to jsp page after upload git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@661582 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/web/action/UploadAction.java | 23 +++++++++++++++++-- .../src/main/resources/xwork.xml | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java index 4680125df..567c5c901 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java @@ -286,6 +286,25 @@ public class UploadAction return INPUT; } + private void reset() + { + // reset the fields so the form is clear when + // the action returns to the jsp page + groupId = ""; + artifactId = ""; + version = ""; + packaging = ""; + classifier = ""; + artifactFile = null; + artifactContentType = ""; + artifactFilename = ""; + pomFile = null; + pomContentType = ""; + pomFilename = ""; + repositoryId = ""; + generatePom = false; + } + public String doUpload() { try @@ -367,10 +386,10 @@ public class UploadAction //TODO: MRM-810 (this writes to archiva.log, should be audit.log) getLogger().info( msg + " by " + getPrincipal() ); - - //TODO: MRM-785 (success message does not display on web page) + addActionMessage( msg ); + reset(); return SUCCESS; } catch ( RepositoryNotFoundException re ) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml index b8309df61..ea788ef62 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml @@ -157,7 +157,7 @@ /WEB-INF/jsp/upload.jsp /WEB-INF/jsp/upload.jsp - upload + /WEB-INF/jsp/upload.jsp -- 2.39.5