struts构建文件上传(三)

这是第二个类action

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) {
}
}

时间: 2024-10-30 14:51:08

struts构建文件上传(三)的相关文章

struts构建文件上传(一)

这是第一个类,与表中的信息相对应(当然如果只是简单的文件上传可以不用这样麻烦,之所以这样作是因为传到数据库里容易管理) package tester.business.maitain; public class Trainplan { private int p_id; private String p_title; private int post_index; private String issue_time; private String issuer; private String p

struts构建文件上传(六)

这是action页面, package tester.business.maitain; import tclcc.tester.util.Selector; import org.apache.struts.action.*; import javax.servlet.http.*; import java.util.*; import org.apache.struts.upload.FormFile; import java.io.*; public class MaintainActio

struts构建文件上传(九)

最后看看struts-config页面的内容 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config

struts构建文件上传(八)

这是view页面viewtrainplan.jsp(上一张jsp名为planManage.jsp) <%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld"

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; p

struts构建文件上传(七)

package tester.business.maitain; import tclcc.tester.business.maitain.Trainplan; import tclcc.tester.util.DBConn; import java.sql.*; import java.util.*; public class TrainPlanDAO { private DBConn dbconn = null; private Connection conn = null; private

struts构建文件上传(四)

与actionform相对应的jsp页面 taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="lo

struts2 文件上传 三种方式

struts.multipart.maxSize=10240000:用于限制上传文件的大小struts.multipart.allowedTypes=.xls,.zip:用于限制上传文件类型struts.multipart.parser=pell:解决上传空文件的报错问题 struts.multipart.saveDir:该属性指定上传文件的临时保存路径,该属性的默认值是javax.servlet.context.tempdir 第一种方式 package com.ljq.action; imp

求指点,Struts多文件上传的问题

问题描述 前台:<form action="upload.action" method="post" enctype="multipart/form-data"><table><td><input name='name_1' value='1'><input type=file name='upload'></td><td><input name='name