Re: [Stripes-users] UTF8 from form to mySQL

2011-02-08 Thread Samuel Santos
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) {

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-07 Thread Yee
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-06 Thread Janne Jalkanen
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:

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-06 Thread Nikolaos Giannopoulos
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-06 Thread Janne Jalkanen
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-05 Thread Janne Jalkanen
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-05 Thread Samuel Santos
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-05 Thread Nikolaos Giannopoulos
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-05 Thread Samuel Santos
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-05 Thread Nikolaos Giannopoulos
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-04 Thread Janne Jalkanen
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-04 Thread Daniil Sosonkin
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-04 Thread Philip Constantinou
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

Re: [Stripes-users] UTF8 from form to mySQL

2011-02-04 Thread Nikolaos Giannopoulos
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