有关jsp无法运行的错误

来源:百度知道 编辑:UC知道 时间:2024/06/18 13:05:09
<%@page import="java.util.*"%>
<%@page contentType="text/html"%>
<%@Page pageEncoding="GB2312"%>
<html><head><title>?? application ??</title></head>
<body>
<%
application.setAttribute("title“,”jsp???????");
application.setAttribute("author","??");
%>
<a href="usingApplication.jsp">??????application ????</a>

</body>
</html>
显示错误信息:type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /usingApplicationData.jsp(3,3) Invalid directive
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j

如果说你用dreamweaver开发的,在修改->页面属性中可以修改编码方式为GB2312,如果用eclipse,也有对于jsp文件的首选项需要配置。这是在开发工具里面显示的乱码的解决方法。
如果在页面中就要把页面的编码方式设为中文,提交给浏览器的为中文
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

得到的数据是乱码,我建设用这一句,request.setCharacterEncoding("gbk");

<%@Page pageEncoding="GB2312"%>
中的'Page'改成小写page