Struts框架 配置文件

<?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 />
 
  <form-beans >
    <form-bean name="loginForm" type="com.yourcompany.struts.form.LoginForm" />
    <form-bean name="shoperForm" type="com.yourcompany.struts.form.ShoperForm" />
    <form-bean name="checkoutForm" type="com.yourcompany.struts.form.CheckoutForm" />
    <form-bean name="registerForm" type="com.yourcompany.struts.form.RegisterForm" />
    <form-bean name="RegisterForm" type="com.yourcompany.struts.form.RegisterForm" />

  </form-beans>

  <global-exceptions />
  <global-forwards />
  <action-mappings >
    <action
      attribute="loginForm"
      input="/form/login.jsp"
      name="loginForm"
      path="/login"
      scope="request"
      type="com.yourcompany.struts.action.LoginAction"
      validate="true">
     
      <forward name="failure" path="/form/login.jsp" />
      <forward name="success" path="/shoper.do" />
     
    </action>
    <action
      attribute="shoperForm"
      name="shoperForm"
      path="/shoper"
      scope="request"
      type="com.yourcompany.struts.action.ShoperAction"
      validate="false">
      <forward name="success" path="/form/shoper.jsp" />
    </action>
    <action
      attribute="checkoutForm"
      input="/form/checkout.jsp"
      name="checkoutForm"
      path="/checkout"
      scope="request"
      type="com.yourcompany.struts.action.CheckoutAction">
      <forward name="success" path="/form/checkout.jsp" />
      <forward name="goshopping" path="/shoper.do" />
      <forward name="RemoveshoppingcartLogout" path="/form/login.jsp" />
    </action>
    <action
      attribute="registerForm"
      input="/form/register.jsp"
      name="registerForm"
      path="/register"
      scope="request"
      type="com.yourcompany.struts.action.RegisterAction" >
      <forward name="success" path="/shoper.do" />
      <forward name="failure" path="/form/register.jsp" />
    </action>
 
  </action-mappings>

  <message-resources parameter="com.yourcompany.struts.ApplicationResources" />
   <plug-in className="com.yourcompany.struts.model.InitDataSource"/>
  
   <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、付费专栏及课程。

余额充值