New. jsp files, CharSet and pageencoding default is iso-8859-1, so that the page will be garbled when accessing the solution: Change CharSet and pageencoding to UTF-8 (or gbk/gb2312/ GB10890, want to know more about several encodings of past life can refer to another article: http://www.cnblogs.com/yadongliang/p/5574353.html).
<%@ Page Language="Java"ContentType="text/html; charset=iso-8859-1"pageencoding="iso-8859-1"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=iso-8859-1"><title>Insert Title here</title></Head><Body></Body></HTML>
View Code
The modified code is as follows:
<%@ Page Language="Java"ContentType="text/html; Charset=utf-8"pageencoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Insert Title here</title></Head><Body> <Scripttype= "Text/javascript">Alert ("Chinese!");</Script>Chinese!</Body></HTML>
View Code
Garbled problem when new JSP file accesses page in eclipse