struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <>
Subject Re: html:rewrite possible bug
Date Mon, 05 May 2003 21:11:28 GMT
Both tags use RequestUtils.computeURL() to generate the url.  That method 
encodes ampersands if it is not a redirect.  This is the correct behavior.


>From: Dennis Muhlestein <>
>Reply-To: "Struts Developers List" <>
>Subject: Re: html:rewrite possible bug
>Date: Mon, 05 May 2003 14:47:18 -0600
>  >Encoding the ampersand is the way it's supposed to work.
> >
>  >
> >David
>The rewrite tag specifies in the documentation that it is supposed to 
>output the parameters the same way the link tag does.  The output is not 
>the same though.
>Note that the values of the parameters do NOT contain an ampersand.
>The values for PARAM1 and PARAM2 are 1 and 2 respectively.
>The expected output is PARAM1=1&PARAM2=2
>When you encode the ampersand ie: PARAM1=1&amp;PARAM2=2
>The decoded params and values are
>This is not the same output as the link tag.  The link tag gives the 
>expected output and only encodes the parameter values.
>Remember, this only occurs when using the name attribute with the rewrite 
>Please advise
>Dennis Muhlestein wrote:
>>We use the rewrite tag occasionally within some javascript.  We have
>>never used it with more than one parameter until today.
>>Today when trying though, the outputted html is incorrect.
>><%      java.util.Hashtable parms = new java.util.Hashtable();
>>         parms.put ( "PARAM1", "1" );
>>         parms.put ( "PARAM2", "2" );
>>         pageContext.setAttribute( "parms", parms ); %>
>>     <!--
>>     function MsgWindow()
>>     {
>>             newWindow = open("<html:rewrite href="/SomeLink"
>>name="parms" />", .......
>>The expcted Output is /SomeLink?PARAM1=1&PARAM2=2
>>Instead, we get /SomeLink?PARAM1=1&amp;PARAM2=2
>>(NOTE THE &amp;)
>>Our workaround for right now is to use a small jsp code snippet to write  
>>our own parameter string, then pass that string to the href parameter of 
>>the rewrite tag.
>>Is this a known issue?  Something is double encoding the parameter string. 
>>  Should I file a bug on this?  It seems like a small issue to fix before 
>>html:rewrite & sslext:rewrite are affected the same way.
>>Neither html:link or sslext:link show this behavior. (Docs say they
>>should behave the same minus the "<a href..." part)
>>We are using 1.1rc1 but also tried this with the nightly build: 20030501
>To unsubscribe, e-mail:
>For additional commands, e-mail:

The new MSN 8: advanced junk mail protection and 2 months FREE*

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message