to qdstar(大鸟) 那页面还需要加上<%@ page contentType="text/html;charset=gb2312%>吗?为什么我一用<%@ page contentType="text/html;charset=gb2312%>就会产生错误: A Servlet Exception Has Occurred org.apache.jasper.compiler.ParseException: /project/addproject.jsp(4,19) Attribute has no value at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563) at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681) at org.apache.jasper.compiler.ParserController.figureOutJspDocument(ParserController.java:265) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:194)
to qdstar(大鸟) :上面的回复是我的语法错误导致,请不必看我是这样理解的,ApplicationResources.properties和ApplicationResources_zh.properties同时存在,页面根据<%@ page contentType="text/html;charset=gb2312%>来判断显示那种语言,是这样吗?
A Servlet Exception Has Occurred
org.apache.jasper.compiler.ParseException: /project/addproject.jsp(4,19) Attribute has no value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)
at org.apache.jasper.compiler.ParserController.figureOutJspDocument(ParserController.java:265)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:194)
我的做法:
1、将存有英文信息的ApplicationResource.properties复制一份,重命名为a(为了减少dos命令的长度);
2、使用Editplus编辑文件a,写入中文信息;
3、在Dos窗口中,切换到文件a所在目录,运行:
native2ascii a ApplicationResource_zh.properties
native2ascii ApplicationResources_zh.properties tmp.txt
tmp.txt里边就是unicode编码,用这些编码替换中文就行了