Hello,
I post some data in JSP which as following:
============== send.jsp ======================
<%@ page language="java" contentType="text/html" %>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<form name="smsForm" action="/send" accept-charset="UTF8" method="POST" focus="name">
<input type=text name="name">
<input type=submit>
And retrive the data in JSP as following:
============= retrieve.jsp =====================
<%@ page language="java" contentType="text/html" %>
<%@ taglib uri="/WEB-INF/tld/share.tld" prefix="share" %>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<share:mydata/>
In the above JSP, I can't get back the correct Chinese if I post some Chinese in the first JSP. After that, if I change the retrieve.jsp to the following retrieve1.jsp, it works.
============= retrieve1.jsp =====================
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/tld/share.tld" prefix="share" %>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<share:mydata/>
I just add the charset in the JSP directive in the contentType. What cause this problem? If I don't want to set the charset in the JSP directive header, how can it display the correct Chinese well?
Eric