UTF-8 Problem with PF 2.2.1

UI Components for JSF
Post Reply
User avatar
MISS_DUKE
Posts: 273
Joined: 08 Aug 2010, 05:52

04 Jun 2011, 04:40

Unable to set request character encoding to UTF-8 from context /myproject, because request parameters have already been read, or ServletRequest.getReader() has already been called
The above message appears in my server logs very often after I upgraded to PF 2.2.1.

When webpages requested by clients, blank pages are returned by the server (I hope this is due the above mentioned character encoding issue) and refreshing (sometimes more than once) required to get the intended pages.

If anyone else face the same issue, please share your experience.
JSF implementation: Mojarra V2.1.7
JSF component library: Primefaces V3.1.1
Server: GlassFish Open Source Edition V3.1.1 (build 12)

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

04 Jun 2011, 14:29

This post can help you. I think you need an encoding filter.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

smallya
Posts: 264
Joined: 19 Mar 2010, 19:22
Contact:

04 Jun 2011, 18:55

MISS_DUKE,
I used to get these messages aplenty in my log. I removed the line
<?xml version="1.0" encoding="UTF-8" ?>

from individual facelets and used it only in the template that I am using. Then these errors stopped.

Also as Oleg mentioned I used a filter to force UTF-8 encoding.

Check out the project - WebUtilities - http://code.google.com/p/webutilities/ that has a filter that does that. It also has other goodies for compression, minify etc that you were inquiring in the past about.
Netbeans 7.2| GlassFish 3.2 | PostgreSQL 9.1| MongoDB | Primefaces 3.4.2
_______________________________________________________________
Subraya Mallya
http://tinyhabit.com |http://twitter.com/tinyhabit

User avatar
MISS_DUKE
Posts: 273
Joined: 08 Aug 2010, 05:52

06 Jun 2011, 03:26

I get the following error message when I use a filter to set UTF-8
java.nio.charset.MalformedInputException: Input length = 1 at com.sun.faces.application.ByteArrayWebOutputStream.writeTo(ByteArrayWebOutputStream.java:115) at com.sun.faces.application.ViewHandlerResponseWrapper.flushToWriter(ViewHandlerResponseWrapper.java:162) at ...
JSF implementation: Mojarra V2.1.7
JSF component library: Primefaces V3.1.1
Server: GlassFish Open Source Edition V3.1.1 (build 12)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests