struts构建文件上传(二)


关键词

struts构建文件上传(二)

摘要

这是第二个类actionform,
package tester.business.maitain;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.apache.struts.upload.*;

public class MaintainForm
   extends ActionForm {

 /** private String p_title;
  private int post_index;
   private String issue_time;
   private String issue;
  private String p_content;
  private String p_accessory;
  private int p_id;
  private java.util.ArrayList post_indexOpts;
  */
 private Trainplan trainPlan = new Trainplan();
 private org.apache.struts.upload.FormFile theFile1;
 private org.apache.struts.upload.FormFile theFile2;
 private org.apache.struts.upload.FormFile theFile3;

这是第二个类actionform,
package tester.business.maitain;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.apache.struts.upload.*;

public class MaintainForm
   extends ActionForm {

 /** private String p_title;
  private int post_index;
   private String issue_time;
   private String issue;
  private String p_content;
  private String p_accessory;
  private int p_id;
  private java.util.ArrayList post_indexOpts;
  */
 private Trainplan trainPlan = new Trainplan();
 private org.apache.struts.upload.FormFile theFile1;
 private org.apache.struts.upload.FormFile theFile2;
 private org.apache.struts.upload.FormFile theFile3;

 public String getP_title() {
   return trainPlan.getP_title();
 }

 public void setP_title(String p_title) {
   trainPlan.setP_title(p_title);
 }

 public void setTrainPlan(Trainplan trainP) {
   this.trainPlan = trainP;

 }

 public Trainplan getTrainPlan() {
   return this.trainPlan;

 }

 public void setTheFile1(org.apache.struts.upload.FormFile theFile1) {
   this.theFile1 = theFile1;
 }

 public org.apache.struts.upload.FormFile getTheFile2() {
   return theFile2;
 }

 public void setTheFile2(org.apache.struts.upload.FormFile theFile2) {
   this.theFile2 = theFile2;
 }

 public org.apache.struts.upload.FormFile getTheFile3() {
   return theFile3;
 }

 public void setTheFile3(org.apache.struts.upload.FormFile theFile3) {
   this.theFile3 = theFile3;
 }

 public org.apache.struts.upload.FormFile getTheFile1() {
   return theFile1;
 }

 public ActionErrors validate(ActionMapping actionMapping,
                              HttpServletRequest httpServletRequest) {
   /**@todo: finish this method, this is just the skeleton.*/
   return null;
 }

 public void reset(ActionMapping actionMapping,
                   HttpServletRequest httpServletRequest) {
 }

}
                                       



 

要饭二维码

洪哥写文章很苦逼,如果本文对您略有帮助,可以扫描下方二维码支持洪哥!金额随意,先行谢过!大家的支持是我前进的动力!

文章的版权

本文属于“洪哥笔记”原创文章,转载请注明来源地址:struts构建文件上传(二):http://www.splaybow.com/post/struts2.html

如果您在服务器运维、网络管理、网站或系统开发过程有需要提供收费服务,请加QQ:8771947!十年运维经验,帮您省钱、让您放心!
亲,如果有需要,先存起来,方便以后再看啊!加入收藏夹的话,按Ctrl+D

« J2EE、J2SE和J2ME struts构建文件上传(三) »

相关文章:

JSP动态包含  (2014/6/28 8:32:24)

JSP静态包含  (2014/6/27 8:24:43)

Java参数化查询无法得到可更新的记录集  (2014/6/26 9:29:00)

jsp包含文件与被包含文件的contentType必须完全一致  (2014/6/25 9:19:33)

Java可以定义元素个数为0的数组  (2014/6/23 11:24:23)

Java中XML的构造与输出  (2014/3/29 11:51:08)

Java中如何把整形int转换成字符串String类型  (2014/3/28 11:31:28)

自动添加超链接  (2014/1/17 9:43:23)

使用keytool生成私钥  (2014/1/2 20:58:48)

Java递归算法示例  (2013/12/29 19:19:50)