You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Delbecq <de...@oma.be> on 2006/01/30 12:02:52 UTC

Is struts handling informations differently between post and get?

Hello dear members,

We created a seach form using struts. The form uses ISO-8859-1 encoding.
When posting a query with accentuaed characters, no problems.
The browser posts this:
scope=%2Ffiles&requestedNodeResults=15&uri=&xsl=&query=pr%E9cipitations&x=0&y=0

notice the %E9 in parameters, which corresponds to 'é' character in iso-8859-1
Struts handles it without problem, showing the query parameter on screen also works perfectly.

However, if i take this query and issues
search.do?scope=%2Ffiles&requestedNodeResults=15&uri=&xsl=&query=pr%E9cipitations&x=0&y=0

It all goes wrong, struts decode the %E9 as an interrogation point!
In both cases (POST and GET) the browser does not send a content-encoding to server (so server has to guess what content encoding is used)
Also, post is not a multipart

So questions are
1) is it expected behaviour that struts behave differently on POST and GET methods regarding the encoding?
2) how to fix it? (i tried switching to utf-8 for query, it got even worse as post also don't work anymore then)


-- 
David Delbecq
Royal Meteorological Institute of Belgium

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is struts handling informations differently between post and get?

Posted by Hubert Rabago <hr...@gmail.com>.
Struts won't change the value of request parameters.  I'm certainly no
encoding expert, but if you want to narrow down the cause, try playing
with a basic servlet and see what it gets from request parameters.

Hubert

On 1/30/06, David Delbecq <de...@oma.be> wrote:
> Hello dear members,
>
> We created a seach form using struts. The form uses ISO-8859-1 encoding.
> When posting a query with accentuaed characters, no problems.
> The browser posts this:
> scope=%2Ffiles&requestedNodeResults=15&uri=&xsl=&query=pr%E9cipitations&x=0&y=0
>
> notice the %E9 in parameters, which corresponds to 'é' character in iso-8859-1
> Struts handles it without problem, showing the query parameter on screen also works perfectly.
>
> However, if i take this query and issues
> search.do?scope=%2Ffiles&requestedNodeResults=15&uri=&xsl=&query=pr%E9cipitations&x=0&y=0
>
> It all goes wrong, struts decode the %E9 as an interrogation point!
> In both cases (POST and GET) the browser does not send a content-encoding to server (so server has to guess what content encoding is used)
> Also, post is not a multipart
>
> So questions are
> 1) is it expected behaviour that struts behave differently on POST and GET methods regarding the encoding?
> 2) how to fix it? (i tried switching to utf-8 for query, it got even worse as post also don't work anymore then)
>
>
> --
> David Delbecq
> Royal Meteorological Institute of Belgium
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org