使用jetty的maven插件(9.x的版本也是一樣)
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.16.v20140903</version>
</plugin>
</plugins>
JSP上的原有的中文都能正常顯示,但是通過model傳遞過來的中文都是亂碼
然后使用Tomcat是正常的
這個jetty是插件,好像也沒地方改編碼
閉關(guān)修行中......
I solved it myself, specify the encoding through the plug-in when compiling with Maven
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>utf8</encoding>
</configuration>
</plugin>