struts-config.xml配置

来源:互联网 发布:建筑安全事故数据 编辑:程序博客网 时间:2024/06/05 17:31

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">

<struts-config>
 <data-sources />
 <!-- 配置form -->
 <form-beans>
  <form-bean name="loginForm" type="mypack.forms.LoginForm" />
  <form-bean name="helloForm" type="mypack.forms.HelloForm" />
  <form-bean name="qEmpForm" type="mypack.forms.QEmpForm" />
  <form-bean name="qDeptForm" type="mypack.forms.QDeptForm" />
  <form-bean name="addEmpForm" type="mypack.forms.AEmpForm" />
  <form-bean name="upFileForm" type="mypack.forms.UpFileForm" />
  <form-bean name="downLoadFrom" type="mypack.forms.DownLoadForm" />
  <form-bean name="dFileForm" type="mypack.forms.DFileFrom">
  </form-bean>
 </form-beans>
 <global-exceptions />
 <global-forwards />
 <action-mappings>
  <!--login -->
  <action path="/login" name="loginForm" scope="session"
   validate="true" input="/Login.jsp"
   type="mypack.actions.LoginAction">
   <forward name="success" path="/Success.jsp"/>
   <forward name="failure" path="/Login.jsp" />
  </action>

  <!-- hello-->
  <action path="/hello" name="helloForm" scope="session"
   validate="false" forward="/Hello.jsp">
  </action>

  <!-- queryEmp -->
  <action path="/query" name="qEmpForm" scope="session"
   validate="false" type="mypack.actions.QEmpAction" parameter="method">
   <forward name="queryEmp" path="/QueryEmp.jsp"></forward>
   <forward name="updateEmp" path="/UpdateEmp.jsp"></forward>
  </action>

  <!-- queryDept -->
  <action path="/qdept" name="qDeptForm" scope="session"
   validate="false" type="mypack.actions.QDeptAction">
   <forward name="queryDept" path="/QueryEmp.jsp"></forward>
  </action>

  <!-- AddEmp -->
  <action path="/addemp" name="addEmpForm" scope="session"
   validate="true" input="/AddEmp.jsp"
   type="mypack.actions.AEmpAction" parameter="method">
   <forward name="addEmp" path="/AddEmp.jsp"></forward>
  </action>

  <!-- 上传文件 -->
  <action path="/upfile" name="upFileForm" scope="request"
   validate="true" input="/UpFile.jsp"
   type="mypack.actions.UpFileAction">
   <forward name="upfile" path="/UpFile.jsp"></forward>
  </action>

  <!-- 下载文件 -->
  <action path="/download" name="downLoadFrom" scope="request"
   validate="false" type="mypack.actions.DownLoadAction">
   <forward name="download" path="/DownLoad.jsp"></forward>
  </action>
  <!-- 删除文件 -->
  <action path="/delete" name="dFileForm" scope="request"
   validate="false" type="mypack.actions.DFileAction">
   <forward name="download" path="/DownLoad.jsp"></forward>
  </action>

 </action-mappings>
 <!-- 配置资源文件 -->
 <message-resources parameter="mypack/ResourceMessage" />
 <message-resources parameter="mypack/ResourceMessage_Hello"
  key="hello" />
</struts-config>

 

原创粉丝点击