亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - Spring mvc 使用mvn jetty:run啟動 頁面上的中文亂碼,Tomcat就沒問題
阿神
阿神 2017-04-18 10:52:22
0
1
591
    使用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)修行中......

reply all(1)
黃舟

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>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template