I’m extending an existing code based on Struts2 (and Struts2-jquery plugin, but I don’t think this is the reason of the problem).
I found a strange behavior with Internet Explorer 9 (I don’t know if the same issue exists also for the previous versions of IE) that doesn’t appear in FireFox.
I’ve a page with some input fields and an upload function used to upload files on the server. When the user upload a file, this is sent to the server by a form submit, then the Action return to the same page (reload the page). If I fill the input boxes using accented letters, when the page is reloaded after the form submit, instead of the accented letters appears a “square” (it is �). This happens only in IE, not in FireFox (where the characters remain the same I’ve before the submit).
In the web.xml and struts.xml files, there are not encoding configuration for the JSP.
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<s:form id="actionForm" name="actionForm"
theme="simple" cssClass="yform"
action="changeAction" acceptcharset="UTF-8">
<table>
<tr>
<td>field1</td>
<td>
<s:textfield id="field1" name="field1" maxlength="2048" value="%{field1}" disabled="false" size="98" required="true" />
</td>
</tr>
<tr>
<td><s:file name="docFacFileUploaded" size="50" /></td>
<td>
<sj:submit targets="main_section" id="uploadFileButton" value="File upload" button="true" indicator="indLoad" />
<img id="indLoad" src="indicator.gif" alt="Loading..." style="display:none" />
</td>
<tr>
</tr>
<td>field2</td>
<td>
<s:textfield id="field2" name="field2" maxlength="2048" value="%{field2}" disabled="false" size="98" required="true" />
</td>
</tr>
<tr>
<td>
<sj:submit targets="main_section" id="salvaButton" value="Salva" button="true" indicator="ind" />
<img id="ind" src="indicator.gif" alt="Loading..." style="display:none" />
</td>
</tr>
</table>
</s:form>
I found a solution in the OTN Forum at URL https://forums.oracle.com/forums/thread.jspa?messageID=3151892
As suggested, I’ve added this in the
web.xmlAnd this to my JSP page
So it rightly worked in IE and FF.