struts-config.xml 配制连接 access

<?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> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值