com.gisgraphy.webapp.action
Class FileUploadAction

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by com.gisgraphy.webapp.action.BaseAction
          extended by com.gisgraphy.webapp.action.FileUploadAction
All Implemented Interfaces:
com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, java.io.Serializable

public class FileUploadAction
extends BaseAction

Sample action that shows how to do file upload with Struts 2.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.gisgraphy.webapp.action.BaseAction
cancel, CANCEL, delete, from, log, mailEngine, mailMessage, roleManager, save, templateName, userManager
 
Fields inherited from class com.opensymphony.xwork2.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
FileUploadAction()
           
 
Method Summary
 java.lang.String execute()
          Default method - returns "input"
 java.io.File getFile()
           
 java.lang.String getFileContentType()
           
 java.lang.String getFileFileName()
           
 java.lang.String getName()
           
 void setFile(java.io.File file)
           
 void setFileContentType(java.lang.String fileContentType)
           
 void setFileFileName(java.lang.String fileFileName)
           
 void setName(java.lang.String name)
           
 java.lang.String upload()
          Upload the file
 void validate()
           
 
Methods inherited from class com.gisgraphy.webapp.action.BaseAction
cancel, getConfiguration, getRequest, getResponse, getSession, saveMessage, sendUserMessage, setDelete, setFrom, setMailEngine, setMailMessage, setRoleManager, setSave, setTemplateName, setUserManager
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setFieldErrors
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUploadAction

public FileUploadAction()
Method Detail

upload

public java.lang.String upload()
                        throws java.lang.Exception
Upload the file

Returns:
String with result (cancel, input or sucess)
Throws:
java.lang.Exception - if something goes wrong

execute

public java.lang.String execute()
Default method - returns "input"

Specified by:
execute in interface com.opensymphony.xwork2.Action
Overrides:
execute in class com.opensymphony.xwork2.ActionSupport
Returns:
"input"

setFile

public void setFile(java.io.File file)

setFileContentType

public void setFileContentType(java.lang.String fileContentType)

setFileFileName

public void setFileFileName(java.lang.String fileFileName)

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

getFile

public java.io.File getFile()

getFileContentType

public java.lang.String getFileContentType()

getFileFileName

public java.lang.String getFileFileName()

validate

public void validate()
Specified by:
validate in interface com.opensymphony.xwork2.Validateable
Overrides:
validate in class com.opensymphony.xwork2.ActionSupport


Copyright © 2010. All Rights Reserved.