| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1197 人关注过本帖
标题:jsp页面加载bean出问题
只看楼主 加入收藏
rineshine
Rank: 1
来 自:保定
等 级:新手上路
帖 子:6
专家分:0
注 册:2009-11-9
结帖率:50%
收藏
已结贴  问题点数:0 回复次数:4 
jsp页面加载bean出问题
---错误提示
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: /rectangle.jsp(3,35) quote symbol expected
    org.apache.(DefaultErrorHandler.java:41)
    org.apache.(ErrorDispatcher.java:407)
    org.apache.(ErrorDispatcher.java:88)
    org.apache.(Parser.java:222)
    org.apache.(Parser.java:162)
    org.apache.(Parser.java:153)
    org.apache.(Parser.java:953)
    org.apache.(Parser.java:1136)
    org.apache.(Parser.java:1449)
    org.apache.(Parser.java:138)
    org.apache.(ParserController.java:239)
    org.apache.(ParserController.java:102)
    org.apache.(Compiler.java:197)
    org.apache.(Compiler.java:372)
    org.apache.(Compiler.java:352)
    org.apache.(Compiler.java:339)
    org.apache.jasper.(JspCompilationContext.java:594)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


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


--------------------------------------------------------------------------------

Apache Tomcat/7.0.11
----jsp文件:
<%@ page language="java" contentType="text/html; charset=gb2312"
    pageEncoding="gb2312"%>
<jsp:useBean id="rectangle" class=bean.Rectangle scope="page"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>javabean 的实例应用</title>
</head>
<body>
<%
    rectangle.setHeigh(4.5);
    rectangle.setWidth(5.0);
   
%>
<div align="center">
<h1> javabean 实例应用</h1>
<p>矩形的长是:<font color="#0000FF"><%=rectangle.getWidth() %></font></p>
<p>矩形的宽是:<font color ="0000FF"><%=rectangle.getHeigh() %></font>
</p>
<p>矩形的周长是:<font color="0000FF"><%=rectangle.getRectangleLength() %></font>
</p>
<p>矩形的面积是:<font color="0000FF"><%=rectangle.getRectangleArea() %></font>
</p>
</div>
</body>
</html>
------bean类
package bean;

public class Rectangle {
    private double width;
    private double height;
    private double rectangleLength;
    private double rectangleArea;
    public Rectangle(){
        this.width=0;
        this.height=0;
        this.rectangleArea=0;
        this.rectangleLength=0;
    }
    public void setWidth(double d){
        this.width=d;
    }
    public double getWidth(){
        return this.width;
    }
    public void setHeigh(double d){
        this.height=d;
    }
    public double getHeigh(){
        return this.height;
    }
    public double getRectangleLength(){
        this.rectangleLength=(this.height+this.width)*2;
        return this.rectangleLength;
    }
    public double getRectangleArea(){
        this.rectangleArea=this.height*this.width;
        return this.rectangleArea;
    }
   
}
搜索更多相关主题的帖子: expected 页面加载 server 
2011-10-13 22:14
gwl3323405
Rank: 2
等 级:论坛游民
帖 子:22
专家分:46
注 册:2010-10-31
收藏
得分:14 
不知道你什么错,检查rectangle.jsp第三行!是你JSP页面的错误。
2011-10-14 10:07
rineshine
Rank: 1
来 自:保定
等 级:新手上路
帖 子:6
专家分:0
注 册:2009-11-9
收藏
得分:0 
jsp页面哪里的问题?请具体点
2011-10-14 12:50
wy198712
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2011-11-8
收藏
得分:0 
没家双引号吧,加上试试!
2011-12-02 14:11
zmp800
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-4-1
收藏
得分:0 
/rectangle.jsp(3,35) quote symbol expected 缺少引号的意思
<jsp:useBean id="rectangle" class=bean.Rectangle scope="page"/> ,class="....."你没加引号
2012-04-01 14:53
快速回复:jsp页面加载bean出问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012613 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved