You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by kiatkin <ki...@yahoo.com> on 2001/03/11 11:04:41 UTC

problem with using redirect tag

I'm trying to pass two value that retrive from cookie to a action class. Here is snipplet.

   <logic:present cookie="a">
    <bean:cookie id="c1" name="a"/>
        <% value = c1.getValue(); %>

          <logic:present cookie="b">
              <bean:cookie id="c2" name="b"/>
             <% String link = new StringBuffer()
                  .append("action.do?valueA=")
                  .append(c1.getValue())
                  .append("&valueB=")
                  .append(c2.getValue())
                  .toString();
              %>
          <logic:redirect href="<%=link%>"/>
     </logic:present>
</logic:present>

when i try to print out the quesy string in action class, it come out something like this

Query string is valueA=aaa&amp;valueB=bbbb

How come the 'amp;' is append after the '&' ?
FYI, i'm using the struts beta version now and these code work for me before i switch to beta version.

TIA 
kiatkin


Re: problem with using redirect tag

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 13 Mar 2001, kiatkin wrote:

> >>Query string is valueA=aaa&amp;valueB=bbbb
> 
> Thx for reply.. but this causing me can't retrieve the second parameter
> (valueB)
> 
>    servlet.log("value A "+ request.getParameter("valueA"));
>    servlet.log("value B " +request.getParameter("valueB"));
> 
> The output is
> value A aaa
> value B null
> 
> It is bug?
> 

Yes, it appears to be a bug.  The "&amp;" sequence is what you get when
you URL-encode a string containing an ampersand, and it looks like Struts
is doing that a little bit too aggressively.

Could you please report a bug to our bug tracking system?

	http://nagoya.apache.org/bugzilla/

That way, it will be sure to be paid attention to.  Sometimes, bug reports
on the mailing lists get lost in the volume of messages.

Thanks,
Craig McClanahan


Re: problem with using redirect tag

Posted by kiatkin <ki...@yahoo.com>.
>>Query string is valueA=aaa&amp;valueB=bbbb

Thx for reply.. but this causing me can't retrieve the second parameter
(valueB)

   servlet.log("value A "+ request.getParameter("valueA"));
   servlet.log("value B " +request.getParameter("valueB"));

The output is
value A aaa
value B null

It is bug?

----- Original Message -----
From: "Incze Lajos" <in...@mail.matav.hu>
To: <st...@jakarta.apache.org>
Sent: Tuesday, March 13, 2001 1:10 AM
Subject: Re: problem with using redirect tag


> > How come the 'amp;' is append after the '&' ?
>
> "&amp;" is the html encoded "&".           incze


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re: problem with using redirect tag

Posted by Incze Lajos <in...@mail.matav.hu>.
> How come the 'amp;' is append after the '&' ?

"&amp;" is the html encoded "&".           incze