struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rubens Gomes <rub...@pocketgear.com>
Subject RE: Struts 2 - s:text garbled
Date Fri, 07 Jan 2011 23:27:26 GMT
No.  I use Struts-2 resource bundle only. And I am running my application on Tomcat 6 with
JDK 1.6.  I use titles though.  And below is a page that I have problem.  

If I remove the first line <%@ page ... %>, <s:text name="pageTitle.common"> renders
the correct characters to the page.  

<!-- Remove following line makes <s:text ...> to render correct Portuguese foreign
characters -->
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" language="java" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"  %>

<c:if test="${sessionScope.userSession.mobile}">
  <s:url var="login" forceAddSchemeHostAndPort="true" scheme="https" namespace="/ssl/security"
action="login" />
  <c:redirect url="${login}" />
</c:if>

<c:set var="pageTitle" scope="request">EZLista - <s:text name="pageTitle.common"
/></c:set>
<c:set var="homePage" value="true" scope="request" />
<c:set var="loginPage" value="true" scope="request" />
<c:set var="transitional" value="true" scope="request" />
<c:set var="iframe" value="true" scope="request" />
<s:set name="redirectUrl" scope="request">/</s:set>

<tiles:insertDefinition name="${sessionScope.userSession.browser}.home.definition">
  <tiles:putAttribute name="title">${requestScope.pageTitle}</tiles:putAttribute>
</tiles:insertDefinition>


-----Original Message-----
From: Dave Newton [mailto:davelnewton@gmail.com] 
Sent: Friday, January 07, 2011 6:19 PM
To: Struts Users Mailing List
Subject: Re: Struts 2 - s:text garbled

Are you using a custom ResourceBundle that handles non-encoded files? Or a
ResourceBundle.control?

Otherwise I'd assume the default XWork/S2 resource bundle isn't the one that
takes an encoding argument, which is a 1.6 (?) thing, so I'd have no problem
believing that was the case.

Dave

On Fri, Jan 7, 2011 at 6:06 PM, Rubens Gomes <rubens@pocketgear.com> wrote:

> No. I do not use native2ascii.  The resource is saved/stored under the
> UTF-8 character set.  Because I edit my resource files from within Eclipse,
> and I have preferences set to UTF-8.
>
> Another piece of information, I know that if I convert the resource file to
> Unicode characters and save it.  Then, the page is rendered okay having the
> pageEncoding tag on the JSP.
>
>
>
> -----Original Message-----
> From: Dave Newton [mailto:davelnewton@gmail.com]
> Sent: Friday, January 07, 2011 6:03 PM
> To: Struts Users Mailing List
> Subject: Re: Struts 2 - s:text garbled
>
> Out of curiosity, did you try after using the native2ascii (or whatever
> it's
> called) tool?
>
> (I've never actually tried non-encoded resource files, but I'm usually
> using
> a tool to create them, so I'm not always sure what I'm actually ending up
> with, because I'm lazy.)
>
> Dave
>
> On Fri, Jan 7, 2011 at 5:51 PM, Rubens Gomes <rubens@pocketgear.com>
> wrote:
>
> > Hello,
> >
> > I already spent several hours on this problem.   And I have done some
> > search on the mailing lists as well.
> >
> > I am using the latest Struts 2 (2.2.1) along with struts-tiles JSP plugin
> > (2.2.2), and I running into a problem with rendering garbled foreign
> > characters from s:text.  If I remove the pageEncoding tag from the top of
> > the JSP page, the <s:text...> works okay.
> >
> > This line when added to the top of the JSP causes <s:text ...> to render
> > incorrect garbled Portuguese characters.
> >
> > <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"
> > language="java" %>
> >
> > All my resource files are saved in UTF-8.  And so is my JSPs.  And I also
> > have the following on all pages.
> >
> > <meta http-equiv="Content-Type" content="application/xhtml+xml;
> > charset=UTF-8" />
> >
> > And I have following settings too:
> >
> > struts.xml:
> > ...
> > <constant name="struts.i18n.encoding" value="UTF-8"/>
> > ...
> >
> > freemaker.properties:
> > default_encoding=UTF-8
> >
> >
> > --
> > Rubens
> >
> >
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message