Christian, this is the filter I was talking about: public class CharacterEncodingFilter implements Filter { private String encoding;
public void destroy() { } public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException { resp.setCharacterEncoding(encoding); chain.doFilter(req, resp); } public void init(FilterConfig config) throws ServletException { encoding=config.getInitParameter("encoding"); } } ----------------------------------------------------------------------------------------------------------------------------------- web.xml <filter> <filter-name>CharacterEncoding</filter-name> <filter-class>com.dbi.norma.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncoding</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> ----------------------------------------------------------------------------------------------------------------------------------- Furthermore IIRC struts2 usually takes into consideration the jsp page directive, particolarly the contentType attribute: <%@ page contentType="text/html; UTF-8" %> OTH Twitter :http://www.twitter.com/m_cucchiara G+ :https://plus.google.com/107903711540963855921 Linkedin :http://www.linkedin.com/in/mauriziocucchiara Maurizio Cucchiara On 13 November 2011 18:31, Maurizio Cucchiara <mcucchi...@apache.org> wrote: > Hi Christian, > I have been using SM in production environments for a long time now. > AFAIK 3.x is fairly stable though is still alpha. > The encoding issues are my nightmare :), you don't never know where > they come from. > The default encoding of S2 is UTF8, anyway to enforce the concept you > could always do: > > <constant name="struts.i18n.encoding" value="UTF-8"/> (struts.xml) > > <parser content-type="text/html;charset=UTF-8" > class="com.opensymphony.module.sitemesh.parser.HTMLPageParser" /> > (sitemesh.xml) > > I usually start from a very simple example, then go ahead (does your > data display correctly without SM?). > How did you import your data inside mysql? > > Ensure that your data was encoded correctly inside the DB itself: > select hex(field) from Table where condition; > As last option you can even consider a Character Encoding Servlet > Filter, but to be frank I never felt the need to use it. > > Twitter :http://www.twitter.com/m_cucchiara > G+ :https://plus.google.com/107903711540963855921 > Linkedin :http://www.linkedin.com/in/mauriziocucchiara > > Maurizio Cucchiara > > > > On 13 November 2011 17:35, Christian Grobmeier <grobme...@gmail.com> > wrote: > > Hi guys, > > > > I am searching for a utf-8 problem in my app. I have struts 2 with > > sitemesh 2.x bundled. backoffice is apache cayenne which connects to > > mysql with: > > &useUnicode=true&characterEncoding=utf8 > > > > Now I suspect sitemesh somehow. Any ideas were I could look appreciated > > > > Is sitemesh still recommended btw? 2.x version is pretty old and 3.x > > is in alpha for quite a while. > > > > Cheers > > Christian > > > > -- > > http://www.grobmeier.de > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > >