]> source.dussan.org Git - archiva.git/commitdiff
[MRM-785]
authorMaria Odea B. Ching <oching@apache.org>
Fri, 30 May 2008 07:43:23 +0000 (07:43 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Fri, 30 May 2008 07:43:23 +0000 (07:43 +0000)
-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-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml

index 4680125dfb6aad68644ffab887572618c4c94a3d..567c5c901f1f41945c3d5147d337ba16ab60e85a 100644 (file)
@@ -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 )
index b8309df613b8ae6ccafe131613a313b49d93f496..ea788ef62744aa7d944fc848355f8e40fd50f9b9 100644 (file)
        <action name="upload" class="uploadAction" method="input">      
       <result name="input">/WEB-INF/jsp/upload.jsp</result>
       <result name="error">/WEB-INF/jsp/upload.jsp</result>
-      <result name="success" type="redirect-action">upload</result>
+      <result name="success">/WEB-INF/jsp/upload.jsp</result>
       <interceptor-ref name="configuredPrepareParamsStack"/>
       <interceptor-ref name="fileUpload"/>
     </action>