struts2拦截器参数传递问题
配置struts2拦截器拦截action时,如果请求url中含有参数,会出现参数丢失的问题。例如:
http://localhost:8080/recommend/portal/appInfo.action?itemId=1007300000053536
参数itemId在请求的action中可能会接收不到。
解决方案:
<action name="appInfo" method="showAppInfo">
<interceptor-ref name="myInterceptor"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="success">/WEB-INF/jsp/AppInfo.jsp</result>
</action>
不配置红色部分,会造成请求参数丢失错误,切记!!!