Hi Yee,
The right answer has already be given to you on previous mails.
1. Configure your LocalePicker:
public class MyLocalePicker implements LocalePicker {
...
@Override
public final String pickCharacterEncoding(HttpServletRequest request,
Locale locale) {
Janne Jalkanen janne.jalkanen@... writes:
Simple solution: declare the accept-charset value on all your forms to be
UTF-8 (and *only* UTF-8), then
put up a simple Filter in front of your chain which says
request.setCharacterEncoding(UTF-8). This
should ensure that you get full unicodes to
Basically, in addition to the other things I mentioned there indeed is one
Stripes configuration that I set... by creating a custom LocalePicker
subclass that picks the character encoding UTF-8... and dropping it the
configured Stripes extensions folder... the relevant code is as follows:
Janne,
Just curious why the need for the filter assuming all your requests go
through Stripes. Do you have other non-Stripe traffic or perhaps the
filter does other things as well. If not, the Stripes code is pretty
clear... it effectively invokes exactly what your filter does... just
curious
It's easy to remember, fast, works across all containers and all frameworks.
Not everyone has the luxury of working with a single framework, even one as
awesome as Stripes. It is not uncommon to have mixed code too, especially if
you have a considerable array of ready-made servlets and
Really??? A filter just to set character encoding??? Although I imagine it
would work isn't that a little sledge hammer-ish ;-)
I seem to recall it was the recommended practice.
Why not just put the following at the top of each of your JSPs (or tweak as
necessary):
%@ page
Hi Daniil,
I've an old post about this topic at
http://www.samaxes.com/2006/12/java-and-utf-8-encoding/.
Hope it helps,
--
Samuel Santos
http://www.samaxes.com/
On Sat, Feb 5, 2011 at 8:16 AM, Janne Jalkanen janne.jalka...@ecyrd.comwrote:
Really??? A filter just to set character
Janne and Samuel,
Ok... I think there are some things that need to be clarified... b/c it
was a while since I set this up in Stripes... I hadn't realized I even
set it up.
Technically speaking yes - you are both correct -
request.setCharacterEncoding(UTF-8) is required and should be
Hi Nikolaos,
My post was about Java EE in general and not about Stripes.
With Stripes, a custom LocalePicker implementation will correctly encode
POST parameters, but you still need to add the URIEncoding=UTF-8 attribute
to your connector configuration.
Cheers,
--
Samuel Santos
Hey Samuel,
Samuel Santos wrote:
Hi Nikolaos,
My post was about Java EE in general and not about Stripes.
This mailing list is about Stripes not Java EE in general :-)
Sorry - couldn't resist - just joking with you :-)
But the OP was asking about UTF-8 with Stripes et al. and both Janne and
Hi there,
So I'm sure there's someone out there who has met this problem and has
found a solution, therefore, let me ask the source. We are dealing with
an international web platform - many many languages. People submit forms
in different languages and it all stored in a mySQL database.
Simple solution: declare the accept-charset value on all your forms to be
UTF-8 (and *only* UTF-8), then put up a simple Filter in front of your chain
which says request.setCharacterEncoding(UTF-8). This should ensure that you
get full unicodes to the ActionBean, and then you only have to deal
Thanks, Janne. I got the Stripe's form to refill with a valid value! But
${actionBean.field} won't work now. I have a filter that sets
request.setCharacterEncoding(UTF-8); as you suggested. Then I print
on my JSP: Last: ${actionBean.test}
The action bean and the form are below. So stripes fills
Daniil --
We're doing all the same stuff and haven't encountered any problems. Here's a
few tidbits from our configuration.
In our mySQL connector we use:
Resource name=jdbc/xxx auth=Container type=javax.sql.DataSource
Janne,
Really??? A filter just to set character encoding??? Although I
imagine it would work isn't that a little sledge hammer-ish ;-)
Why not just put the following at the top of each of your JSPs (or tweak
as necessary):
%@ page language=java pageEncoding=UTF-8
15 matches
Mail list logo