zoukankan      html  css  js  c++  java
  • 如何为应用指定多个struts配置文件

    如何为应用指定多个struts配置文件
    在大部分应用里,随着应用规模的增加,
    系统中Action的数量也会大量增加,导致struts.xml配置文件变得非常臃肿,
    为了避免struts.xml文件过于庞大、臃肿,提高Struts.xml文件的可读性,
    我们可以将一个struts.xml配置文件分解成多个配置文件,
    然后再struts.xml文件中包含其他配置文件。

    通过<include>元素指定多个配置文件
    <struts>
      <include file="department.xml"/> 一个模块使用一个配置文件
      <include file="employee.xml"/>
    </struts>

    --------------------------------------------------------------------------------------------------------

    动态方法调用
    使用通配符定义Action即*
    <package name="employee" namespace="/control/employee" extends="struts-default">
          <action name="list_*" class="cn.itcast.action.HelloWorldAction" method="{1}">
                <result name="success">/WEB-INF/page/message.jsp</result>
          </action>
    </package>
    通过通配符动态调用方法

  • 相关阅读:
    企业级 SpringBoot 教程 (九)springboot整合Redis
    03 网格系统
    02 表单
    01 排版
    客户端调用webSerices
    sql 一行转多行
    sql 多行转一行
    时间差计算 Stopwatch
    sql 游标
    Linq连接查询
  • 原文地址:https://www.cnblogs.com/wuhuisheng/p/2097795.html
Copyright © 2011-2022 走看看