I have a problem encoding the outcome of an action method into UTF-8 using.
Glassfish 3.1.2 is set to UTF-8: <parameter-encoding default-charset="UTF-8"/>
and entering following UTF-8 encoded url into the browser results in correct decoded view-parameter retrieval in the bean/converter.
/sites/foo.xhtml?paramKey=Getr%C3%A4nke
-> /sites/foo.xhtml?paramKey=Getränke
Getränke
is retrieved correctly in the backing bean and my converters can retrieve the correct objects.
Problem:
Within a bean method that is invoked by a command component view parameters are appended to the targeted view-id that will be returned.
public String action()
{
return "/sites/foo.xhtml?paramKey=Getränke&faces-redirect=true";
}
Will result in an ISO-8859-1 encoded url instead of UTF-8 encoded after the redirect:
/sites/foo.xhtml?paramKey=Getr%E4nke
Did I missed to define UTF-8 somewhere?
Or do I manually have to encode the outcome to UTF-8 myself, which works. Strangely the basic links like h:link
work fine.
System:
Glassfish 3.1.2 Mojarra 3.1.23 Primefaces 3.5f Omnifaces: 1.6 snapshot
Note: also removed PrettyURL
or //Rewrite
for testing to make sure this cannot be the reason.
Note: for testing also added following to a filter:
if (request.getCharacterEncoding() == null)
response.setCharacterEncoding("UTF-8");