That's the expected behaviour; s:url's encode attribute specifies that each parameter should be encoded, not that the entire result should be. If it gave what you're expecting, it wouldn't be giving back a valid URL.

What you need to do is store the url in a variable (using <s:url var="url"...) and then encode the result (e.g. with <s:property value="%{url} encode=true"...).

L.

Vinny wrote:
I am having an issue with s:url as well
I set s:url's  encode="true"

I want to Data.asp?id=1&subId=2 to look like: Data%2Easp%3Fid%3D1%26subId%3D2

What I get instead is Data.asp?id=1&amp;subId=2
Is this the expected behavior?
Don't know if this is the problem the original poster had.

Thanks


On Jan 13, 2008 6:34 PM, Laurie Harper <[EMAIL PROTECTED]> wrote:
GF wrote:
Hi all
I'm using Struts 2.0.6 If I try to set "encode" to true and I pass in
the URL get some bad characters.. such as '<', '>' it doesn't encode
them when it generates the URL with <s:url >
Is this a bug? Has been fixed in recent version?
Thanks
s:url sets encode to true by default, but the documentation for that
attribute says, "Whether to encode parameters." What are you passing in,
what are you getting out, and what were you expecting to get back?
Sample code showing how you're using the tag would also be useful.

L.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to