当前位置: 代码迷 >> Java Web开发 >> javabean跟jsp运行出现的错误
  详细解决方案

javabean跟jsp运行出现的错误

热度:290   发布时间:2007-04-21 13:10:44.0
javabean跟jsp运行出现的错误

type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
C:\jakarta-tomcat-5.0.28\work\Catalina\localhost\javabean\org\apache\jsp\Count_jsp.java:6: 需要 '.'
import Counter;
^
1 错误

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

搜索更多相关主题的帖子: javabean  jsp  运行  

----------------解决方案--------------------------------------------------------
bean文件出错了吧
----------------解决方案--------------------------------------------------------
Count.jsp里出错,无法编译!
----------------解决方案--------------------------------------------------------
回复:(lgdcky)Count.jsp里出错,无法编译!
Count.jsp


<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="Counter" %>
<html>
<body><font size=10>
<jsp:useBean id="people" class="Counter">
</jsp:useBean>
<% if(session.isNew())
{ %>
<P>您是第
<jsp:getProperty name= "people" property="count"/>
位访问本站的人
<%
}
else
{ out.print("禁止通过刷新增加计数!");
}
%>
</font>
</body>
</html>

----------------解决方案--------------------------------------------------------
回复:(lgdcky)Count.jsp里出错,无法编译!

Counter.java


public class Counter
{
long count=0;
public synchronized long getCount()
{
count++;
return count;
}

}

感谢大虾的回复


----------------解决方案--------------------------------------------------------
  相关解决方案