Java、Eclipse、Html的中文问题
eclipse -> project -> properties -> 可以选择text file 的编码方式,中文的话选择utf-8然后在html页面上加入:
<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> ...</head
html页面的中文显示就搞定了
在response.setContentType(...)中,和
在struts.xml 中:
<action name="new" class="blogAction" method="newBlog"><result name="success" type="freemarker"><param name="location">/WEB-INF/ftl/blog/editBlog.ftl</param><param name="contentType">text/html;charset=GBK</param></result></action> 也可以设置contentType,struts.xml可以覆盖掉html页面上的content-type设置
页:
[1]