jsp有点小异常,请大神帮忙,感激不敬
jsp有点小错误,请大神帮忙,感激不敬
有错误
错误的代码
------解决方案--------------------
The method isLogined(boolean) in the type UserBean is not applicable for the arguments ()
user.isLogined() javabean中的isLogined 方法是无参的吗?
------解决方案--------------------
贴一下 user 类看看
------解决方案--------------------
28行 干掉传参,改为 public boolean isLogined(){
------解决方案--------------------
页面上相当于new了一个UserBean,jsp页面上的user是它的变量名称
logined 是它的一个属性,可以直接通过user.isLogined 来读取logined值
你先试试看
------解决方案--------------------
Java类里面是isLogined(boolean) 页面是 isLogined() 参数对不上
<body>
<h2>用户登录认证</h2>
<hr>
<%
//user对象的userName和UserPWD是通过自省完成赋值的
String userName=user.getUserName();
String userPWD=user.getUserPWD();
String sql="select *from user where userName=''+userName+''and userPwd=''+userPWD+''";
if(user.isLogined()){
out.println("你已经登录通过了");
}else{
ResultSet rs=myDBbean.query(sql);
if(rs.next()){
user.setLogined(true);
out.println("恭喜你登录成功");
}
else{
user.setLogined(false);
out.println("对不起,你的账户名和密码有错误,请重新登录");
}
}
%>
</body>
有错误
错误的代码
Multiple annotations found at this line:
- The method isLogined(boolean) in the type UserBean is not applicable for the
arguments ()
------解决方案--------------------
The method isLogined(boolean) in the type UserBean is not applicable for the arguments ()
user.isLogined() javabean中的isLogined 方法是无参的吗?
------解决方案--------------------
贴一下 user 类看看
------解决方案--------------------
28行 干掉传参,改为 public boolean isLogined(){
------解决方案--------------------
页面上相当于new了一个UserBean,jsp页面上的user是它的变量名称
logined 是它的一个属性,可以直接通过user.isLogined 来读取logined值
你先试试看
------解决方案--------------------
Java类里面是isLogined(boolean) 页面是 isLogined() 参数对不上