zoukankan      html  css  js  c++  java
  • Struts2.5框架使用通配符指定方法

    struts框架使用的通配符调用方法配置:

    <package name="hew" extends="struts-default">
        <!-- 配置Action -->
        <action name="action_*" class="action" method="{1}">
            <result name="SUCCESS">index.jsp</result>
        </action>
    </package>

    其中<action name="action_*" class="action">中的name="action_*"中的*代表的是method="{1}"中的{1}的值,并对应Action类中的一个方法名。

    注:struts2.3之前使用以上配置正常,struts2.3之后,使用通配符调用方法要加上<allowed-mthods>方法名1,方法名2..</allowed-mthods>

    <package name="hew" extends="struts-default">
        <!-- 配置Action -->
        <action name="action_*" class="action" method="{1}">
            <result name="SUCCESS">index.jsp</result>
            <allowed-mthods>方法名1,方法名2..</allowed-mthods>
        </action>
    </package>
  • 相关阅读:
    uva 10900
    uva 11181
    Codeforces Round #256 (Div. 2) Multiplication Table
    UVALive 3977
    LA 4384
    Linear Regression
    Hadoop InputFormat浅析
    codeforces 432D Prefixes and Suffixes
    php学习小记2 类与对象
    php学习小记1
  • 原文地址:https://www.cnblogs.com/Anlotus/p/5967425.html
Copyright © 2011-2022 走看看