jsp程序问题

来源:百度知道 编辑:UC知道 时间:2024/06/19 00:46:08
<%@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>用ie打开此程序错误如下,请高手指点;HTTP Status 500 -
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(4,3) Invalid directive
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja

你写的没有问题,你把“<%@Page pageEncoding="GB2312"%>”这一句删掉重新再写一遍就肯定应该没问题了。

你没有指定语言属性
在指令中指定语言属性。
<%@ page language="java"%>

把 <%@page contentType="text/html"%>
<%@Page pageEncoding="GB2312"%>
换成
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />就可以了

<%@page import="java.util.*"%>
<%@page contentType="text/html"%>
<%@Page pageEncoding="GB2312"%>
改成:

<%@ page content="text/html; charset=gb2312" %>