代码之家  ›  专栏  ›  技术社区  ›  Vincent Ramdhanie

Struts2 2.0.x版处理未知操作

  •  0
  • Vincent Ramdhanie  · 技术社区  · 17 年前

    在struts2版本2.1.x中,有一个新的UnknownHandler,当请求到达并且找不到操作名称时,它将启动。

    问题是…如果在2.0.x版本中存在,那么等效的机制是什么?

    1 回复  |  直到 17 年前
        1
  •  1
  •   steamer25    17 年前

    http://struts.apache.org/2.0.14/docs/action-configuration.html#ActionConfiguration-WildcardMethod

    <action name="*">
      <result>/{1}.jsp</result>
    </action>
    

    ...

    <package name="Hello" extends="action-default">
    
        <default-action-ref name="UnderConstruction">
    
        <action name="UnderConstruction">
            <result>/UnderConstruction.jsp</result>
        </action>
    
        ...