19.06.27 16:57 작성
·
324
0
아이디랑 비번을 치면 넘어가야하는데
자꾸 에러가나요ㅠㅠ 에러는
Type Exception Report
Message Can't find a method to write property [userID] of type [java.lang.String] in a bean of type [user.User]
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: Can't find a method to write property [userID] of type [java.lang.String] in a bean of type [user.User] org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:321) org.apache.jsp.loginAction_jsp._jspService(loginAction_jsp.java:125) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.
이렇게 뜹니다
제코드는 똑같이헀는데요..
package user;
public class User {
private String userID;
private String userPassword;
private String userName;
private String userGender;
private String userEmail;
public String getUserID() {
return userID;
}
public void setUserId(String userID) {
this.userID = userID;
}
public String getUserPassword() {
return userPassword;
}
public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserGender() {
return userGender;
}
public void setUserGender(String userGender) {
this.userGender = userGender;
}
public String getUserEmail() {
return userEmail;
}
public void setUserEmail(String userEmail) {
this.userEmail = userEmail;
}
}
//loginAction
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="user.UserDAO" %>
<%@ page import="java.io.PrintWriter" %>
<% request.setCharacterEncoding("UTF-8"); %>
<jsp:useBean id ="user" class="user.User" scope="page"/>
<jsp:setProperty name ="user" property="userID"/>
<jsp:setProperty name="user" property="userPassword"/>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JSP web board page</title>
</head>
<body>
<%
UserDAO userDAO = new UserDAO();
int result = userDAO.login(user.getUserID(), user.getUserPassword());
if (result == 1){
PrintWriter script = response.getWriter();
script.println("<script>");
script.println("location.href = 'main.jsp'");
script.println("</script>");
}else if(result == 0){
PrintWriter script = response.getWriter();
script.println("<script>");
script.println("alert('Invalid Password')");
script.println("history.back()");
script.println("</script>");
}
else if(result == -1){
PrintWriter script = response.getWriter();
script.println("<script>");
script.println("alert('User ID doesn't exist')");
script.println("history.back()");
script.println("</script>");
}
else if(result == -2){
PrintWriter script = response.getWriter();
script.println("<script>");
script.println("alert('Database error is occured')");
script.println("history.back()");
script.println("</script>");
}
%>
</body>
</html>
대체 뭐가 문제인걸까요?
답변