jsp url 传多个参数时出现“&amp”,得不到正确的传递参数

在使用JSP的s:param传参数时,一个参数可以成功,但多个参数时就不成功了,开始第一感觉是jsp的url不能使用s:param传多个参数,但是在网上搜到的结果是可以,传多个参数,而且这是strut2支持的。试了无数次都不成功,开始以后我的参数在url上没有传进去,但看url时上面明明有我要传的参数,而且要传的数据也正确,但就是在action里得到不这些数据。

后来看页面的url时,发现参数与参数之间有个奇怪的符号 :&amp  .在网上查到说是参数之间的连接符应该是: & .

后来终于解决了。

网上解决方法页面如下:

 

From: Bert Van den Brande <cyruzb <at> gmail.com>
Subject: Re: s:url - escapeAmp Problem
Newsgroups: gmane.comp.jakarta.struts.user
Date: 2009-01-07 12:26:52 GMT (17 weeks, 3 days, 1 hour and 20 minutes ago)

From the documentation : http://struts.apache.org/2.1.2/docs/url.html
escapeAmp : Specifies whether to escape ampersand (&) to (&amp or not

So I guess in order to have the url showing "&" you need to set
"escapeAmp" to "false" ...

On Wed, Jan 7, 2009 at 10:14 AM, Himanshu Rathore
<mymailsubscription <at> gmail.com> wrote:
> Hi,
>
> Can anyone please tell me what I'm doing wrong?
>
>
> <s:url id="url" action="register_load" escapeAmp="true">
>
> <s:param name="userId" value="%{userId}"/>
>
> <s:param name="callingPage" value="'callingPage'"/>
>
> </s:url>
> URL is still showing me "&amp;" instead of "&".
>
> --
> Regards,
> Himanshu Rathore
>
特别感谢!
【此页面转自http://article.gmane.org/gmane.comp.jakarta.struts.user/164407
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值