Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Servlet/JSP/JSF/JavaFX Script
打印话题 寄给朋友 订阅主题 |
作者 | 简单JavaBean调用老实失败,请兄弟们指教 |
AaronTong
发贴: 12 |
于 2007-11-23 10:16
我的代码是《白领就业指南:J2EE开发员成长之路》一书上原版抄过来的,感觉部署都没问题,但是运行的时候老提示错误,我是新手解决不了,已经困惑我好几天了,请指教啊 TaxRate.java如下: package tax; public class TaxRate { String product; double rate; public TaxRate(){ this.product = "A001"; this.rate = 5; } public void setProduct (String ProductName) { this.product = ProductName; } public String getProduct() { return (this.product); } public void setRate (double rateValue) { this.rate = rateValue; } public double getRate () { return (this.rate); } } JSP如下: <HTML> <BODY> <%@ page language="java" %> <jsp:useBean id="taxbean" scope="application" class="tax.TaxRate" /> <% taxbean.setProduct("A002"); taxbean.setRate(17); %> 产品:<%=taxbean.getProduct() %> <br> 税率:<%=taxbean.getRate() %> </BODY> </HTML> 部署如下:TaxRate.java编译后的class文件放在D:\Tomcat5.5\webapps\ROOT\useBean\WEB-INF\classes\tax下。 JSP文件在D:\Tomcat5.5\webapps\ROOT\useBean下。 运行后提示错误: org.apache.jasper.JasperException: /useBean/UseBean.jsp(4,0) The value for the useBean class attribute tax.TaxRate is invalid. 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) root cause org.apache.jasper.JasperException: /useBean/UseBean.jsp(4,0) The value for the useBean class attribute tax.TaxRate is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1174) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) org.apache.jasper.compiler.Node$Root.accept(Node.java:456) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Generator.generate(Generator.java:3320) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198) org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) org.apache.jasper.compiler.Compiler.compile(Compiler.java:264) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305) 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) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs. 请兄弟们指教啊,在线等 联想游戏(欢迎跟贴,哈) |
话题树型展开 |
人气 | 标题 | 作者 | 字数 | 发贴时间 |
3121 | 简单JavaBean调用老实失败,请兄弟们指教 | AaronTong | 3136 | 2007-11-23 10:16 |
2475 | Re:简单JavaBean调用老实失败,请兄弟们指教 | AaronTong | 414 | 2007-11-23 10:43 |
2207 | Re:简单JavaBean调用老实失败,请兄弟们指教 | 无行 | 146 | 2007-11-24 10:35 |
2475 | Re:简单JavaBean调用老实失败,请兄弟们指教 | AaronTong | 16 | 2007-11-24 15:21 |
2585 | Re:简单JavaBean调用老实失败,请兄弟们指教 | AaronTong | 44 | 2007-12-07 14:48 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |