You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
In my JSF Facelets application f:ajax is uesed,but error codes happend with japanese characters.
It is easily reproducible.
Here is the reproducer(demoapp). demoapp.zip
1.index.xhtml <h:form id="form1"> <h:commandButton value="go to homePage" action="home.xhtml" /> </h:form>
input japanese characters(for example:テスト) in displayed input box.(Ajax request)
click "submit".
click "submit" again.
When click "submit" again,you'll see the error codes happen.
By debuging mojarra source,I find that in the step5 the response header content type's charset is set to UTF-8.What I expect is Windows-31j should to be set.
The causes of the error codes are as follows:
In step4,
the ajax request(uri is /home.xhtml) is sent when the data is entered.
Because it's an ajax request,charset=UTF-8 is set in request content type by the following source.
moreover,the UTF-8 is cached by the key of its request uri in a method of com.sun.faces.util.ExpiringConcurrentCache#get.
In step5,click "submit" an request(uri is also /home.xhtml) is sent.
The key is also /home.xhtml,so UTF-8 can be got from the cache and then be set to response header content type,and browser's encoder becomes UTF-8.
In step6,when click "submit" again,the default encoding of a request the container uses is Windows-31j not UTF-8,
different from the browser's encoder(UTF-8),so I think the error codes hanppen.
Is it a JSF bug?
Who can give me some thoughts?
Thanks!
The text was updated successfully, but these errors were encountered:
In my JSF Facelets application f:ajax is uesed,but error codes happend with japanese characters.
It is easily reproducible.
Here is the reproducer(demoapp).
demoapp.zip
1.index.xhtml
<h:form id="form1"> <h:commandButton value="go to homePage" action="home.xhtml" /> </h:form>
2.home.xhtml
<h:form> <h:inputText id = "inputName" value = "#{userData.name}"> <f:ajax event="focus" render="@this" listener="#{userData.welcomeMessage()}" /> </h:inputText> <h:commandButton id="getCode" value="submit" action="#{userData.getVisible()}" /><br/> <br/> <table width="120" border="0" cellpadding="0" cellspacing="0" style="#{userData.isVisible()}"> <tr> <td> <h:outputText id="outputText" value="#{userData.name}"/> </td> </tr> </table> </h:form>
3.glassfish-web.xml
<parameter-encoding default-charset="Windows-31j"/>
Steps to reproduce:
http://ip:port/demoapp/index.xhtml
When click "submit" again,you'll see the error codes happen.
By debuging mojarra source,I find that in the step5 the response header content type's charset is set to UTF-8.What I expect is Windows-31j should to be set.
The causes of the error codes are as follows:
In step4,
the ajax request(uri is /home.xhtml) is sent when the data is entered.
Because it's an ajax request,charset=UTF-8 is set in request content type by the following source.
moreover,the UTF-8 is cached by the key of its request uri in a method of com.sun.faces.util.ExpiringConcurrentCache#get.
In step5,click "submit" an request(uri is also /home.xhtml) is sent.
The key is also /home.xhtml,so UTF-8 can be got from the cache and then be set to response header content type,and browser's encoder becomes UTF-8.
In step6,when click "submit" again,the default encoding of a request the container uses is Windows-31j not UTF-8,
different from the browser's encoder(UTF-8),so I think the error codes hanppen.
Is it a JSF bug?
Who can give me some thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: