当前位置: 技术问答>java相关
jsp调用bean中方法出错,高高分
来源: 互联网 发布时间:2015-04-09
本文导语: Bean文件: package show; import java.io.*; public class showit implements Serializable { private String msg ; public showit(){ msg="abc"; } public String getmsg(){ return msg; } public void setmsg(String msg){ this.msg=msg; } }; jsp文件:++++++++...
Bean文件:
package show;
import java.io.*;
public class showit implements Serializable
{
private String msg ;
public showit(){
msg="abc";
}
public String getmsg(){
return msg;
}
public void setmsg(String msg){
this.msg=msg;
}
};
jsp文件:+++++++++++++++++++++++++++++++++++++++++++++
package show;
import java.io.*;
public class showit implements Serializable
{
private String msg ;
public showit(){
msg="abc";
}
public String getmsg(){
return msg;
}
public void setmsg(String msg){
this.msg=msg;
}
};
jsp文件:+++++++++++++++++++++++++++++++++++++++++++++
|
我试了试,程序没问题,是不是你的环境没配置好呀
|
不好意思,上面讲的都不对,当作没看见吧!
|
是不是show包的问题,没有建相应的目录结构
|
你改成这样:
Bean文件:
package show;
import java.io.*;
public class showit implements Serializable
{
private String msg ;
public showit(){
msg="abc";
}
public String getMsg(){
return msg;
}
public void setMsg(String msg){
this.msg=msg;
}
};
Bean文件:
package show;
import java.io.*;
public class showit implements Serializable
{
private String msg ;
public showit(){
msg="abc";
}
public String getMsg(){
return msg;
}
public void setMsg(String msg){
this.msg=msg;
}
};