gpt4 book ai didi

java - Struts2准备方法

转载 作者:行者123 更新时间:2023-11-30 06:35:26 25 4
gpt4 key购买 nike

我有一个 Action 类,在我的 struts.xml 中为每个 Action 映射了不同的方法。我希望在我的其他方法映射到 struts.xml 之前调用不同的准备方法。

最佳答案

简单地创建一个

void prepareMethodName(){}

其中 MethodName 是您的 per-method Preparable 方法的名称。默认情况下,prepare() 方法在调用此方法后仍会运行。

请参阅:http://struts.apache.org/2.0.14/docs/prepare-interceptor.html

关于java - Struts2准备方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6081224/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com