org.YoUmail
Class AttachAction

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended byorg.YoUmail.AttachAction

public class AttachAction
extends org.apache.struts.action.Action

处理附件上传

Version:
1.0 2004-1-22
Author:
topmint

Field Summary
 
Fields inherited from class org.apache.struts.action.Action
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY
 
Constructor Summary
AttachAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
private  void upload(org.apache.struts.upload.FormFile theFile, java.lang.String writeTo)
          上传文件
 
Methods inherited from class org.apache.struts.action.Action
execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachAction

public AttachAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

upload

private void upload(org.apache.struts.upload.FormFile theFile,
                    java.lang.String writeTo)
             throws java.io.IOException,
                    UploadFileTooLargeException
上传文件

Parameters:
theFile - FormFile
writeTo - 目标地址
Throws:
java.io.IOException
UploadFileTooLargeException