eclipse及tomcat设置编码

新装的eclipse新导入项目会乱码,解决办法:css

右击项目选properties,找到resources选择utf-8html

改后乱码解决web

乱码解决后可能还会有红叉,project clean便可windows

一劳永逸:windows 熟悉,找到web,设置jsp、html、css编码tomcat

 

 general——workspace——other设置utf-8eclipse

general——content types——jsp手动输入utf-8,而后点update,点ok便可jsp

 tomcat设置编码编码

打开server.xml,在8080(你启动的端口)上设置添加URIEncoding="UTF-8"便可spa

<Connector URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>

 

 

20191213:新导入的properties文件还会乱码,修改以下未知的编码为utf-8。其它文件也可如法炮制@参考文章.net

相关文章
相关标签/搜索