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_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="examineeActionForm" type="tclcc.tester.business.ExamineeActionForm" />
<form-bean name="maintainForm" type="tclcc.tester.business.maitain.MaintainForm" />
<form-bean name="addPlanForm" type="tclcc.tester.business.maitain.AddPlanForm" />
</form-beans>
<global-forwards>
<forward name="veiwtrainplan" path="/veiwtrainplan.jsp" />
</global-forwards>
<action-mappings>
<action name="examineeActionForm" path="/admin/showMain" type="tclcc.tester.business.ShowMain">
<forward name="success" path="/admin/examinee/main.jsp" />
</action>
<action input="/admin/examinee/addExaminee.jsp" name="examineeActionForm" path="/admin/saveAddExaminee" type="tclcc.tester.business.SaveAddExamineeAction">
<forward name="success" path="/admin/showMain.do" />
</action>
<action name="examineeActionForm" path="/admin/addExaminee" type="tclcc.tester.business.AddExamineeAction">
<forward name="success" path="/admin/examinee/addExaminee.jsp" />
</action>
<action input="/admin/maintain/planManage.jsp" name="maintainForm" path="/maintainAction" scope="request" type="tclcc.tester.business.maitain.MaintainAction" validate="true">
<forward name="trainplanCreated" path="/veiwtrainplan.jsp" />
</action>
<action name="maintainForm" path="/initAction" scope="request" type="tclcc.tester.business.maitain.InitAction" validate="true">
<forward name="maintain" path="/admin/maintain/planManage.jsp" />
</action>
</action-mappings>
</struts-config>

这里的数据库连接等都要读者自己配置,我们在开发这个试验时的环境为weblogic+jbuilder+oracle

时间: 2024-11-28 17:53:43

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构建文件上传(八)

这是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构建文件上传(三)

这是第二个类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; privat

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

使用struts的文件上传组件,偶尔会出现read time out的问题,请问这是怎么回事???

问题描述 java.net.SocketTimeoutException:Readtimedoutatjava.net.SocketInputStream.socketRead0(NativeMethod)atjava.net.SocketInputStream.read(SocketInputStream.java:155)atorg.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:747)atorg

struts 2 文件上传-struts 2 上传文件时,怎么样让它的默认路径是WebRoot工程下的目录

问题描述 struts 2 上传文件时,怎么样让它的默认路径是WebRoot工程下的目录 在struts2框架中使用文件上传,在 Action 的处理上传的业务方法中将临时文件中的数据保存到指定路径的文件中,我需要保存到项目的WebRoot目录下的upload文件夹中 用 String filePath=ServletActionContext.getServletContext().getRealPath("/upload/")+uploadFileName 指定文件的保存目录. 输