如何获取Struts2拦截器init参数
我在struts.xml中定义了一个拦截器,如下所示:如何获取Struts2拦截器init参数,struts2,Struts2,我在struts.xml中定义了一个拦截器,如下所示: <interceptor name="ssoAuthenticationInterceptor" class="net.ysccc.sso.authentication.AuthenticationInterceptor"> <param name="casServerLoginUrl">http://localhost:8080/cas/login</param>
<interceptor name="ssoAuthenticationInterceptor" class="net.ysccc.sso.authentication.AuthenticationInterceptor">
<param name="casServerLoginUrl">http://localhost:8080/cas/login</param>
<param name="serverName">http://localhost:8080</param>
<param name="renew">false</param>
<param name="gateway">false</param>
</interceptor>
http://localhost:8080/cas/login
http://localhost:8080
假的
假的
现在在拦截器类中,我想获取参数,有一种方法是在类中定义getter setter方法,但我不想使用这种方法,有人能告诉我怎么做吗?对所有参数使用getter和setter,拦截器中的属性必须是公共的
casServerLoginUrl
serverName
renew
gateway
使用setter有什么问题?@AleksandrM,没什么,我只是想知道是否还有其他方法this@DigengTianhan描述您为什么需要它,以及为什么不能使用bean属性?