【发布时间】:2017-09-18 18:20:39
【问题描述】:
我想要一个动作默认值,但不是在 XML 中,因为我想通过 Struts2 Conventions Plugin 使用注释。
所以我想替换
<package abstract="true" namespace="/" name="mypackage" extends="struts-default">
<default-action-ref name="index"/>
</package>
在注释中有一些东西,所以我不必使用 struts.xml 文件,还可以在 URL 中指定未知操作时重定向到特定操作。
Struts2 Convention Plugin 是否对此提供支持,或者是否有任何基于注释的好解决方法?
【问题讨论】:
-
默认操作和结果处理(即 /products 将尝试 com.example.actions.Products 以及 com.example.actions.products.Index)
标签: struts2 struts2-convention-plugin