struts构建文件上传(二)

2016-02-19 14:59 9 1 收藏

下面是个超简单的struts构建文件上传(二)教程,图老师小编精心挑选推荐,大家行行好,多给几个赞吧,小编吐血跪求~

【 tulaoshi.com - 编程语言 】

  这是第二个类actionform,

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

  

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

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)

来源:https://www.tulaoshi.com/n/20160219/1608541.html

延伸阅读
标签: Web开发
PHP(Hypertext Preprocessor)是一种 HTML 内嵌式的语言 (类似 IIS 上的ASP)。而 PHP 独特的语法混合了 C、Java、Perl 以及 PHP 式的新语法。它可以比 CGI 或者 Perl 更快速的执行动态网页。除此之外,用 PHP 写出来的 Web 后端CGI 程序,可以很轻易的移植到不同的系统平台上。 我们在做网站时,需要访问者的参于才能将网站建设得更加...
一、概述 Model就是在对用户请求的整个控制过程中,真正处理用户请求并保存处理结果的对象,在整个过程中,我们一般利用JavaBean来把一些信息保存起来以便在各个对象之间传递。因为在框架中,Model对象是真正处理商业逻辑功能的对象,因此也就是框架中应用需求实现相关性最大的部分。 在Struts的实现里,Model的具体表现形式就是ActionForm...
Model就是在对用户请求的整个控制过程中,真正处理用户请求并保存处理结果的对象,在整个过程中,我们一般利用JavaBean来把一些信息保存起来以便在各个对象之间传递。因为在框架中,Model对象是真处理商业逻辑功能的对象,因此也就是框架中应用需求实现相关性最大的的部分。在Struts的实现里,Model的具体表现形式就是ActionForm对象和与其...
标签: PHP
  文件提交页面既已生成,下面任务就很明确了:将提交的文件内容保存到服务器上。 下面我们用两种方法来实现这个功能: 1. 用 PHP 来保存: 我们先定义一个文件保存函数 fup() 它有两个参数:      $filename: 文件内容      $fname: 文件名(包含路径) 剩下的就是写一个循环...
标签: ASP
  <% ' upload.asp Function IntMin(n,y)     If n<y and n0 Then         IntMin=Int(n)     ElseIf y0 Then         IntMin=Int(y)     Else      &...

经验教程

689

收藏

39
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部