When using the Eclipse editor to develop JSP pages, the jetty startup service will be garbled in Chinese, but with Tomcat Chinese is normal.
At first, I thought it was me. Background code does not do encoding transcoding settings, after the online series of documents to check the adjustment, Chinese and garbled.
But then I found that when I directly access the JSP, do not go through the background code jump, the same phenomenon. This is my confirmation that it is the problem of my JSP page itself.
When I select the JSP page right-click on the property, look at the encoding type Iso8859-1, modified to UTF-8, again access to the JSP page, or garbled.
At this time I also modified the Eclipse window-"property in the Web JSP page settings and contranter JSP page encoding settings, changed to UTF-8, after testing or garbled."
My JSP page uses the include tag, I have a common header file page, the page has been written pageencoding= "UTF-8", as follows
<% @page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%>
But this garbled page of mine did not write this sentence. Finally I will each JSP page add this sentence, again test, Chinese normal, garbled disappeared.
Summarize:
The JSP page should be written in the first sentence to encode the settings, whether the page has no reference to other pages.
Of course, it may be that Tomcat is compatible with Chinese, so using Tomcat as a server JSP page does not require that each page be set to be encoded.
Jetty as a service JSP Chinese garbled, Tomcat as a service JSP Chinese normal