<?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>
<data-sources >
<data-source key="org.apache.struts.action.DATA_SOURCE">
<set-property property="password" value="" />
<set-property property="minCount" value="3" />
<set-property property="maxCount" value="10" />
<set-property property="user" value="" />
<set-property property="driverClass" value="sun.jdbc.odbc.JdbcOdbcDriver" />
<set-property property="description" value="" />
<set-property property="url" value="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)}; DBQ=D://数据库//myaddrbook.mdb" />
<set-property property="readOnly" value="false" />
<set-property property="autoCommit" value="true" />
<set-property property="loginTimeout" value="" />
</data-source>
</data-sources>
<form-beans >
<form-bean name="listForm" type="com.yourcompany.struts.form.ListForm" />
<form-bean name="addForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="mobile" type="java.lang.Integer" />
<form-property name="jobTitle" type="java.lang.String" />
<form-property name="email" type="java.lang.String" />
<form-property name="firstName" type="java.lang.String" />
<form-property name="id" type="java.lang.Integer" />
<form-property name="offph" type="java.lang.Integer" />
<form-property name="department" type="java.lang.String" />
<form-property name="lastName" type="java.lang.String" />
<form-property name="yanzheng" type="java.lang.String" />
</form-bean>
<form-bean name="modify_firstForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="id" type="java.lang.Integer" />
</form-bean>
<form-bean name="modify_secondForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="mobile" type="java.lang.Integer" />
<form-property name="jobTitle" type="java.lang.String" />
<form-property name="email" type="java.lang.String" />
<form-property name="firstName" type="java.lang.String" />
<form-property name="id" type="java.lang.Integer" />
<form-property name="offph" type="java.lang.Integer" />
<form-property name="department" type="java.lang.String" />
<form-property name="lastName" type="java.lang.String" />
</form-bean>
<form-bean name="deleteForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="id" type="java.lang.Integer" />
</form-bean>
</form-beans>
<!--
-->
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="listForm"
input="/error.jsp"
name="listForm"
path="/list"
scope="request"
type="com.yourcompany.struts.action.ListAction"
validate="false">
<forward name="success" path="/list.jsp" />
</action>
<action
attribute="addForm"
input="/error.jsp"
name="addForm"
path="/add"
scope="request"
type="com.yourcompany.struts.action.AddAction">
<forward name="success" path="/index.jsp" />
</action>
<action
attribute="modify_firstForm"
input="/error.jsp"
name="modify_firstForm"
path="/modify_first"
scope="request"
type="com.yourcompany.struts.action.Modify_firstAction">
<forward name="success" path="/modify.jsp" />
</action>
<action
attribute="modify_secondForm"
input="/error.jsp"
name="modify_secondForm"
path="/modify_second"
scope="request"
type="com.yourcompany.struts.action.Modify_secondAction">
<forward name="success" path="/index.jsp" />
</action>
<action
attribute="deleteForm"
input="/error.jsp"
name="deleteForm"
path="/delete"
scope="request"
type="com.yourcompany.struts.action.DeleteAction">
<forward name="success" path="/index.jsp" />
</action>
</action-mappings>
<!-- 以下代码段的<plug-in>是把插件Application加入到struts里 -->
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
<plug-in className = "org.apache.struts.validator.ValidatorPlugIn">
<set-property property = "pathnames"
value = "/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
</struts-config>