我们有一个 servlet 程序,它使用 servlet 程序中的 HTML 代码,即
HTML.append("<html>");
HTML.append(lnTag);
HTML.append("<head>");
HTML.append(lnTag);
HTML.append("<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>");
String titalsLang = resourceBundle.getString("eayslip.tan.title");
HTML.append("<title>"+resourceBundle.getString("eayslip.tan.title")+"</title>");</i>
// and list of codes...
out.print(HTML);
response.setContentType("text/html; charset=UTF-8");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
我在调试代码时从属性文件中获取汉字。但是一旦响应发送到页面,在 html 页面中我们会得到问号?????。
我们对英文字符没有任何问题,并且它们显示正确。