Topic: 经典问题,太头痛了!(<jsp:useBean 出错:wrong name)

  Print this page

1.经典问题,太头痛了!(<jsp:useBean 出错:wrong name) Copy to clipboard
Posted by: inyoung
Posted on: 2005-08-24 15:56

请尽量使用准确的文字描述作为标题
Your next post without a proper Subject will be removed.

Original subject :
经典问题,太头痛了!


今天写了个javabean编译后将class文件放于
c:\tomcat\webapps\ROOT\WEB-INF\classes\test\下,
在ROOT目录下的index.jsp进行如下调用:
<jsp:useBean id="try" class="test.mybean" />
显示出错:
test/mybean (wrong name: mybean)
请问一下为什么?
//以下是mybean.java内容:
class mybean{
private String myname;
public String getName(){return myname;}
public void setName(String value){myname=value;}
public mybean(){
myname="hello world!";
}
}

2.Re:经典问题,太头痛了! [Re: inyoung] Copy to clipboard
Posted by: gaohuawei
Posted on: 2005-08-24 18:58

怎么没人回复啊?

3.Re:经典问题,太头痛了! [Re: inyoung] Copy to clipboard
Posted by: inyoung
Posted on: 2005-08-24 19:03

人气不旺?

4.Re:经典问题,太头痛了! [Re: inyoung] Copy to clipboard
Posted by: chengbd
Posted on: 2005-08-24 19:22

来个完整的web程序最好

5.Re:经典问题,太头痛了! [Re: inyoung] Copy to clipboard
Posted by: zzw109433
Posted on: 2005-08-25 17:08

少了package 你的<jsp:useBean id="try" class="test.mybean" /> 指出类是 test.mybean 可你的 类文件没有package test

6.Re:经典问题,太头痛了! [Re: inyoung] Copy to clipboard
Posted by: zcjl
Posted on: 2005-09-05 21:21

class mybean
>>>public class mybean

try it

7.Re:经典问题,太头痛了!(<jsp:useBean 出错:wrong name) [Re: inyoung] Copy to clipboard
Posted by: inyoung
Posted on: 2005-09-07 18:28

问题已得到解决,确实是CLASSPATH的问题~
谢谢大家

8.Re:经典问题,太头痛了!(<jsp:useBean 出错:wrong name) [Re: inyoung] Copy to clipboard
Posted by: why
Posted on: 2005-09-07 21:45

inyoung wrote:
问题已得到解决,确实是CLASSPATH的问题~
谢谢大家

CLASSPATH的问题?Question
閣下設了甚麼classpath,怎样影響?


   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