在 Struts2 中,我们可以在不使用动作类的情况下定义动作struts.xml
,如下所示:
<action name="error">
<result>/error.jsp</result>
</action>
在我的应用程序中,我正在使用struts2 convention
. 在这种情况下如何避免编写动作类。我有很多场景,我只想去页面而不使用任何业务逻辑。
我的结果路径不仅仅是一个 JSP。我正在使用瓷砖。我使用的代码如下:
@Action(value="homePage", results={@Result(name="success", location="homePage", type="tiles")})