日期:2014-05-18  浏览次数:20685 次

javabean调用错误
小弟刚学jsp是个新手,在使用javabean是老是报错,请各位大哥帮小弟指点,小弟不胜感激。我的调用页面如下:
<%@   page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.sql.* "   errorPage= " "%>
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN "   "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<jsp:useBean   id= "D "   class= "javabean "   scope= "application "/>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 无标题文档 </title>
</head>

<body>
<jsp:setProperty   name= "D "   property= "* "/>
name:
<jsp:getProperty   name= "D "   property= "name "/>
password:
<jsp:getProperty   name= "D "   property= "password "/>
</body>
</html>
报错页面如下:
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:   Unable   to   compile   class   for   JSP

An   error   occurred   at   line:   4   in   the   jsp   file:   /tt.jsp
Generated   servlet   error:
E:\Tomcat   5.0\work\Catalina\localhost\test\org\apache\jsp\tt_jsp.java:46:   找不到符号
符号:   类   javabean
位置:   类   org.apache.jsp.tt_jsp
            javabean   D   =   null;
            ^


An   error   occurred   at   line:   4   in   the   jsp   file:   /tt.jsp
Generated   servlet   error:
E:\Tomcat   5.0\work\Catalina\localhost\test\org\apache\jsp\tt_jsp.java:48:   找不到符号
符号:   类   javabean
位置:   类   org.apache.jsp.tt_jsp
                D   =   (javabean)   _jspx_page_context.getAttribute( "D ",   PageContext.APPLICATION_SCOPE);
                          ^


An   error   occurred   at   line:   4   in   the   jsp   file:   /tt.jsp
Generated   servlet   error:
E:\Tomcat   5.0\work\Catalina\localhost\test\org\apache\jsp\tt_jsp.java:50:   找不到符号
符号:   类   javabean
位置:   类   org.apache.jsp.tt_jsp
                    D   =   new   javabean();
                                    ^


An   error   occurred   at   line:   13   in   the   jsp &n

相关资料更多>