第1个文件test_application.jsp
<%@page contentType= "text/html;charset=gb2312 " import= "java.sql.* "%>
<html>
<head>
<title> use counter </title>
</head>
<body>
ceshi application yemian <br>
<jsp:include page= "application.jsp ">
<jsp:param name= "counter_name " value= "test_application "/>
</jsp:include>
</html>
第2个文件application.jsp
<%@page contectType= "text/html;charset=gb2312 "%>
<%
int count=0;
String counter_name=request.getParameter( "counter_name ");
try
{
count=Integer.parseInt((application.getAttribute(counter_name).toString()));
}
catch(Exception e)
{
}
out.println( "yi fangwen " +count+ "ci ");
count++;
application.setAttribute(counter_name,new Integer(count));
%>
报错:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Exception in JSP: /test_application.jsp:8
5: </head>
6: <body>
7: ceshi application yemian <br>
8: <jsp:include page= "/application.jsp ">
9: <jsp:param name= "counter_name " value= "test_application "/>
10: </jsp:include>
11: </html>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
org.apache.jsp.test_005fapplication_jsp._jspService(test_005fapplication_jsp.java:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)