And I guess that the form bean attributes is set prior to any code in the
form class, so that you can't set the characterEncoding in the form class
(at, for example, the beginning of initialize() method), or...?

Joe Germuska wrote:
> 
>>I had problem with character encoding in my web application. I was trying
to
>>display Polish characters using UTF-8 but data from forms was not getting
in
>>proper format to the business layer. I managed to solve this by setting
>>filter  which does request.setCharacterEncoding(encoding); But the
question
>>is: WHY it didn't work when I was using request.setCharacterEncoding() in
>>Action's execute() method??
> 
> The request's character encoding can only be set before the input 
> values are read.  By the time the Action executes, the ActionForm has 
> already been populated, which means that the request has already 
> deserialized the request parameters from bytes on the wire into Java 
> Strings.  Thus, a ServletFilter is the best way to make sure that 
> this value is set at the earliest possible time.
> 
> Hope this helps,
>       Joe
> 
> -- 
> Joe Germuska            
> [EMAIL PROTECTED]  
> http://blog.germuska.com    
> "Narrow minds are weapons made for mass destruction"  -The Ex
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Character-encoding...-tf297678.html#a9630453
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to