首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

struts2拦截器参数传递有关问题

2012-09-08 
struts2拦截器参数传递问题配置struts2拦截器拦截action时,如果请求url中含有参数,会出现参数丢失的问题。

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>
不配置红色部分,会造成请求参数丢失错误,切记!!!

热点排行