Topic: 部署引用了JavaBean的JSP文件出现问题,急!

  Print this page

1.部署引用了JavaBean的JSP文件出现问题,急! Copy to clipboard
Posted by: greennba99
Posted on: 2004-01-25 15:29

Light BulbJSP文件代码:
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<head>
<title>
jsp1
</title>
</head>
<jsp:useBean id="Bean" scope="session" class="Jsp1Bean" />
<jsp:setProperty name="Bean" property="*" />
<body bgcolor="#ffffff">
<h1>
JBuilder Generated JSP
</h1>
<form method="post">
<br>Enter new value : <input name="sample"><br>
<br><br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
<br>
Value of Bean property is :<jsp:getProperty name="Bean" property="sample" />
</form>
</body>
</html>

Light BulbJavaBean文件代码:
public class Jsp1Bean
{
private String sample = "Start value";
//Access sample property
public String getSample()
{
return sample;
}
//Access sample property
public void setSample(String newValue)
{
if (newValue!=null)
{
sample = newValue;
}
}
}

Light Bulb这两个文件的代码都是JBuilder自己生成的,应该没有错误,并且没有使用包。

Light Bulb但在JBuilder中编译JSP文件后的错误信息:
"jsp1.jsp": Error #: 300 : class Jsp1Bean not found in class jsp_servlet.__jsp1 at line 8
"jsp1.jsp": Error #: 300 : class Jsp1Bean not found in class jsp_servlet.__jsp1 at line 8
"jsp1.jsp": Error #: 300 : class Jsp1Bean not found in class jsp_servlet.__jsp1 at line 8
"jsp1.jsp": Error #: 300 : class Jsp1Bean not found in class jsp_servlet.__jsp1 at line 8

Light Bulb部署到WebLogic中后访问JSP文件出现以下错误信息:
Compilation of 'E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java' failed:
--------------------------------------------------------------------------------
E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:126: cannot resolve symbol
probably occurred due to an error in /jsp1.jsp line 8:
<jsp:useBean id="Bean" scope="session" class="Jsp1Bean" />

E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:127: cannot resolve symbol
probably occurred due to an error in /jsp1.jsp line 8:
<jsp:useBean id="Bean" scope="session" class="Jsp1Bean" />

E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:130: cannot resolve symbol
probably occurred due to an error in /jsp1.jsp line 8:
<jsp:useBean id="Bean" scope="session" class="Jsp1Bean" />

E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:132: cannot resolve symbol
probably occurred due to an error in /jsp1.jsp line 8:
<jsp:useBean id="Bean" scope="session" class="Jsp1Bean" />

--------------------------------------------------------------------------------
Full compiler errorMoon:
E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:126: cannot resolve symbol
symbol : class Jsp1Bean
location: class jsp_servlet.__jsp1
Jsp1Bean Bean = null; //[ /jsp1.jsp; Line: 8]
^
E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:127: cannot resolve symbol
symbol : class Jsp1Bean
location: class jsp_servlet.__jsp1
Bean = (Jsp1Bean)session.getAttribute("Bean"); //[ /jsp1.jsp; Line: 8]
^
E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:130: cannot resolve symbol
symbol : class Jsp1Bean
location: class jsp_servlet.__jsp1
Bean = (Jsp1Bean)session.getAttribute("Bean"); //[ /jsp1.jsp; Line: 8]
^
E:\MyServer\mydomain\.\MusicServer\.wlnotdelete\extract\MusicServer_testAPP_testAPP\jsp_servlet\__jsp1.java:132: cannot resolve symbol
symbol : class Jsp1Bean
location: class jsp_servlet.__jsp1
Bean = new Jsp1Bean(); //[ /jsp1.jsp; Line: 8]
^
4 errors

--------------------------------------------------------------------------------
Sat Jan 24 18:16:09 CST 2004

Light Bulb请问要怎么解决,我是初学者,请详细解答,非常感谢!!!!!!!!!!!!!!!!

2.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: clinker
Posted on: 2004-01-26 00:23

你用的服务器是不是tomcat?有的版本的tomcat要求javabean必须有package。试试加一句package com.yourcom;

3.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: greennba99
Posted on: 2004-01-28 10:29

是WebLogic

4.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: why
Posted on: 2004-01-28 21:24

greennba99 wrote:
是WebLogic

哪有没有试过加入package?

5.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: 我的聪聪
Posted on: 2004-01-29 16:57

用包就可以了,我以前也碰过的。

6.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: dorrenchen
Posted on: 2004-01-30 02:33

you have to import the class before you can use it. add next line into your jsp page.

<%@ page import="Jsp1Bean" %>

7.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: greennba99
Posted on: 2004-02-01 16:21

非常感谢!!!!

8.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: caibenny_361
Posted on: 2004-03-04 22:09

太高深了,我是初学者
学习先。。。。。。

9.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: longwalk
Posted on: 2004-03-09 17:30

究竟是用import bean class 解决的,还是把bean class放在包中解决的?

10.Re:部署引用了JavaBean的JSP文件出现问题,急! [Re: greennba99] Copy to clipboard
Posted by: hohaischooldays
Posted on: 2004-03-10 11:05

Of cource "import bean class",or it don't know what it is!


   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