|
Hi,
Are you using tiles for your
application?
I had similar problems when tried to add
the
<meta HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=UTF-8"/>
in html from another jsp than the one that was base
template (that specified in <definition name="layout"
path="/WEB-INF/tiles/basetemplate.jsp"> in tiles.xml) for
tiles.
I added the meta tag in base template for tiles and
started the f:view declaration after </head>. After this my pages started
to work even in case of a validation error.
Did you checked out the simple/masterDetail
example? This is an example that use UTF-8 and it is working.
Hope this helps,
Alin.
Hi Laurie,
Thanks.
I added the following to the beginning of each jsp page.
<%@ page language="java" contentType="text/html; charset=UTF-8"
%>
After the page shows up, the browser says UTF-8. This is great.
when I typed in some chinese characters using InputText, and
left another InputText empty(required) that would cause
validation error and force JSF to re-display the
page, the chinese characters became question marks(?) after display
back.
The page says UTF-8. Will browser(IE) encode everything in UTF-8? How
about server-side (JSF)? any character conversions?
I tried to add encoding="UTF-8" to <h:form>, but it is not
allowed.
Thanks for help.
Laurie Harper <[EMAIL PROTECTED]>
wrote:
>
Does the browser(IE) or do the encoding of characters?
If
the inputText component has an initial value, it will be encoded
server-side using the view's output encoding. When you submit the form,
the browser will encode the current value of the inputText using
whatever encoding it chooses to submit with -- usually the same as the
encoding of the page containing the form.
>> I set the
browser(IE) encoding to Unicode before typing the East Asia >>
characters, after submit, the browser encoding changed to
Western >> Europe(ISO).
So it looks like you're sending the
browser a page that's encoded as ISO-8859-something, not UTF-8. That
wont work for Asian characters, of course.
>> From browser
view/source, >> >> >
CONTENT="text/html;charset=UTF-8"> >> >> it says
UTF-8.
That's in your 'meta' tag in the HTML 'head'? What do you have
in your JSP to specify the page encoding, other than the meta tag? Are
you using a page directive? The meta tag is not enough by itself to tell
the JSP engine to use UTF-8 encoding.
The JSP engine needs to
know the correct output encoding to use. If it's using one encoding
(ISO-8859-?), but your meta tag specifies the page uses a different
encoding (UTF-8), things are going to get messed up; the data is sent in
IS0-8859-? but the browser is trying to decode it using
UTF-8.
L.
Dave wrote: > In my configuration I have only
English. The locale config is for resource bundle. But the problem I have is
the East Asia input and display, not locale support. > I can type East
Aisa characters such as Chinese into the without prob lems, but
when they display back after submit, the characters becomes something
like: > &3435;&3489;&3988;&8987; > They seemed
to be encoded somehow. > > Does the browser(IE) or
do the encoding of characters? Thanks. > >
---------------------- > > >
de >
de >
en > >
> > Thomas Spiegl <[EMAIL PROTECTED]>wrote: Did you add
a locale-config to your faces-config.xml ? > > >
> de > de > en > > > Thomas >
> On 12/23/05, Dave wrote: >> I have a [input] . when I type
some East Asia characters into it, they >> are displaying
correctly. But after clicking submit button, they did not >> show
back correctly. >> >> One thing I
noticed. >> >> I set the browser(IE) encoding to Unicode
before typing the East Asia >> characters, after submit, the
browser encoding changed to Western >> Europe(ISO). From browser
view/source, >> >> >
CONTENT="text/html;charset=UTF-8"> >> >> it says
UTF-8. >> >> Note: submit did not store data in database,
everything is in memory. >> Browser does character conversion ? or
JSF does some conversion? >> >> Confused !! What needs to
be done for JSF web application to support >> characters other than
English? >> >> Thanks in advance for advice. >>
Dave >> >> ________________________________ >>
Yahoo! DSL Something to write home about. Just $16.99/mo. or less >
> > -- > http://www.irian.at > > Your JSF
powerhou se - > JSF Consulting, Development and > Courses in
English and German > > Professional Support for Apache
MyFaces > > > > >
--------------------------------- > Yahoo! for Good - Make a
difference this year.
Yahoo!
DSL Something to write home about. Just $16.99/mo. or
less
|