I have problem with I18N in JSP, specifically, with forms.
When I enter some Czech characters (e.g., "ěščřžýá...") into my page one form, into the field "fieldOne
", and then show text from that field on page two, instead of Czech characters I see this as "ÄÄ". (Note, the second page gets the Czech characters with "request.getProperty("fieldOne")
")
Here is the source code:
Page one:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<html>
<head></head>
<body>
<form action="druha.jsp" method="post">
<input type="textarea" name="fieldOne">
<input type="submit">
</form>
</body>
</html>
Page two:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<html>
<head></head>
<body>
<h1>The text: </h1> <%=request.getProperty("fieldOne")%>
</body>
</html>
Thanks for help...