[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
This commit is contained in:
Maria Odea B. Ching 2008-05-30 07:43:23 +00:00
parent 86628294c8
commit b4f9994165
2 changed files with 22 additions and 3 deletions

View 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 )

View File

@ -157,7 +157,7 @@
<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>