请求一个struct2的action 跳转到另一个页面 跳转后页面的url已有上一页面传过来的参数 但是在跳转后的页面中却取不到对应的参数
下面是跳转后页面的url:
http://localhost:8080/04/articleAction_queryArticlesByUserOfArticle?article.articleId=139&article.user.userName=cdd
但是 在该页面中<s:if test="{user.userName!=null}">
<s:property value="user.userName"/>
</s:if>
却获取不到 user.userName
下面是跳转后页面的url:
http://localhost:8080/04/articleAction_queryArticlesByUserOfArticle?article.articleId=139&article.user.userName=cdd
但是 在该页面中<s:if test="{user.userName!=null}">
<s:property value="user.userName"/>
</s:if>
却获取不到 user.userName
解决方案 »
- jquery的ajax和struts验证返回json问题
- java软件开发
- apache ftpserver的数据库管理用户
- 【急】刚装的MyEclipse启动不了了 求高手帮忙
- 为什么要把spring和struts整合起来,不把struts整进spring,直接一起用不可以吗?
- spring中如何根据时间调用dao中的方法
- 超简单问题,请指点!
- java.lang.IllegalStateException: response already committed
- socket和端口的问题???
- 帮帮忙,EJB-QL问题:如何使用Timestamp数据类型进行查找? 急,在线等!!!
- SQL语句优化
- 新手关于spring的一个异常,求助啊!!!
${user.userName }直接打印试试
还有你的s:if的struts2标签里面用了el表达式这是不允许的。把el的{}去掉
<s:if test="user.userName!=null">
<s:property value="user.userName"/>
</s:if>
user里面没有数据 用${user.userName}时 页面总会出什么吧 现在什么都没有
action没有user对象的返回
<s:if test="#parameters.article.user.userName!=null">
<s:property value="#parameters.article.user.userName"/>
</s:if>
<s:if test="#parameters.article.user.userName!=null">
<s:property value="#parameters.article.user.userName"/>
</s:if>
同意楼上的分析,你debug看一下值栈里存的是啥.
嗯 知道了 谢谢