jsp和javaBean问题 20
我的Tomcat是4.1安装版的,运行一切正常..可是我用到javabean组件时就出现问题了...下面是我的例子Circle.javapublicclassCircle...
我的Tomcat是4.1安装版的,运行一切正常..
可是我用到javabean组件时就出现问题了...
下面是我的例子 Circle.java
public class Circle {
int radius;
public Circle(){
radius=1;
}
public int getRadius(){
return radius;
}
public void setRadius(int newRadius){
radius=newRadius;
}
public double circleArea(){
return Math.PI*radius*radius;
}
public double circlLength(){
return 2.0*Math.PI*radius;
}
}
然后我编辑成.class放到D:\myapp\WEB-INF\classes\Circle.class
JSP页面为:
<%@ page contentType="text/html;charset=GB2312"%>
<%@ page import="tom.*"%>
<html>
<body bgcolor=cyan><font size=5>
<jsp:useBean id="girl" class="tom.Circle" scope="page"/>
</jsp:useBean>
<%
girl.setRadius(100);
%>
<p>圆的半经是:
<%=girl.getRadius()%>
<p>圆的周长是:
<%=girl.circlLength()%>
<p>圆的面积是:
<%=girl.circleArea()%>
</body>
</html>
然后运行tomcat出现这样的情况
HTTP Status 500
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org/apache/jasper/runtime/HttpJspBase
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
请问各位高手...为什么会出现这种情况...是不是我JavaBean部署有问题啊...还是其它的问题...初学者不懂
高手们帮帮我...我搞了几天了....都是这种情况...谢谢你们了
我QQ号:5404978
我的JSP页面在D:\myapp\area.jsp
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
Apache Tomcat/4.1.18 展开
可是我用到javabean组件时就出现问题了...
下面是我的例子 Circle.java
public class Circle {
int radius;
public Circle(){
radius=1;
}
public int getRadius(){
return radius;
}
public void setRadius(int newRadius){
radius=newRadius;
}
public double circleArea(){
return Math.PI*radius*radius;
}
public double circlLength(){
return 2.0*Math.PI*radius;
}
}
然后我编辑成.class放到D:\myapp\WEB-INF\classes\Circle.class
JSP页面为:
<%@ page contentType="text/html;charset=GB2312"%>
<%@ page import="tom.*"%>
<html>
<body bgcolor=cyan><font size=5>
<jsp:useBean id="girl" class="tom.Circle" scope="page"/>
</jsp:useBean>
<%
girl.setRadius(100);
%>
<p>圆的半经是:
<%=girl.getRadius()%>
<p>圆的周长是:
<%=girl.circlLength()%>
<p>圆的面积是:
<%=girl.circleArea()%>
</body>
</html>
然后运行tomcat出现这样的情况
HTTP Status 500
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org/apache/jasper/runtime/HttpJspBase
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
请问各位高手...为什么会出现这种情况...是不是我JavaBean部署有问题啊...还是其它的问题...初学者不懂
高手们帮帮我...我搞了几天了....都是这种情况...谢谢你们了
我QQ号:5404978
我的JSP页面在D:\myapp\area.jsp
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
Apache Tomcat/4.1.18 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询