QeelwaEtech / omnifaces

Automatically exported from code.google.com/p/omnifaces
0 stars 1 forks source link

o:onloadScript breaks encoding on ajax reload using primefaces #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add onloadScript to any page using ajax reload and primefaces components. 
Script can contain anything.
2. Use the ajax functionality of for example p:commandButton. Reloaded parts of 
page will get broken special characters. In my case, 'å', 'ä' and 'ö' are 
replaced by '�'. See attachment for minimal example

What is the expected output? What do you see instead?
Expected output is correct rendering of non standard ASCII chars.

What OmniFaces version are you using? What JSF impl/version are you using? 
Omnifaces 3.0, using JSF version bundled in JBoss 6.1.
What servletcontainer impl/version are you using? If any, what JSF
component library impl/version are you using? Using versions bundled in Jboss 
6.1. Also using Primefaces.

Please provide any additional information below.
Non-ajax posts renders the page correctly. Using standard JSF ajax 
functionality (h:commandbutton for example) also works correctly. Also, the 
script did not run again after the ajax call as it is promised to do.

Original issue reported on code.google.com by rasmus.f...@gmail.com on 7 Mar 2013 at 11:39

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to mention, using Primefaces 2.2.1

Original comment by rasmus.f...@gmail.com on 7 Mar 2013 at 12:36

GoogleCodeExporter commented 9 years ago
Sorry, can't reproduce it using PrimeFaces 2.2.1 and Mojarra 2.1.19 on Tomcat 
7.0.37.

Have you tried <f:view encoding="UTF-8">?

Which Mojarra version exactly are you using?

Original comment by balusc on 7 Mar 2013 at 2:26

GoogleCodeExporter commented 9 years ago
Using Mojarra 2.0.3. f:view with encoding has no effect. I stripped my project 
down to the absolute minimum and noticed that it worked for me as well. Adding 
libraries one by one made me find the culprit: 
org.apache.myfaces.webapp.filter.ExtensionsFilter. When tomahawk is added to 
the project and this filter is active, I get the error described in the ticket.

Original comment by rasmus.f...@gmail.com on 7 Mar 2013 at 4:30

GoogleCodeExporter commented 9 years ago
Reproduced when ExtensionsFilter of Tomahawk 1.1.14 for JSF 2.0 is being added.

I workarounded it by setting the response encoding to be the same as request 
encoding, which is what Mojarra is internally also doing: 
https://code.google.com/p/omnifaces/source/detail?r=bc05601399d9c64ba1336d103163
2c6392220d37

The below snapshot contains the fix.

Original comment by balusc on 8 Mar 2013 at 8:11

Attachments: