JSP -->registerBean.registerBean cannot be resolved to a type
-
Hi, experimentie ein bischen mit JSP und habe folgendes problem
An error occurred at line: 2 in the jsp file: /registerView.jsp registerBean.registerBean cannot be resolved to a type 1: <%@ page errorPage="errorpge.jsp" import="registerBean.*"%> 2: <jsp:useBean id="register" scope="session" class="registerBean.registerBean"/> 3: 4: 5: <html> An error occurred at line: 2 in the jsp file: /registerView.jsp registerBean.registerBean cannot be resolved to a type 1: <%@ page errorPage="errorpge.jsp" import="registerBean.*"%> 2: <jsp:useBean id="register" scope="session" class="registerBean.registerBean"/> 3: 4: 5: <html>
JSP datei
<%@ page errorPage="errorpge.jsp" import="registerBean.*"%> <jsp:useBean id="register" scope="session" class="registerBean.registerBean"/> <html> <body> <b>Register</b> <% String name =""; String email=""; String password=""; String repassword=""; switch(register.getStatus()) { case register.ALLOK: { out.println("Dose ta stixeia stin forma"); break; } case register.EMPTY: { out.println("Den simpliro8ike sosta h forma"); break; } case register.PASSWORDMISSMATCH: { password = ""; repassword = ""; out.println("Ta Password den einai idia"); break; } case register.USEREXIST: { name = ""; out.println("O xristis eiparxei eidi"); break; } case register.DBError: { out.println("Error DBConection dokimase argotera"); break; } default: { out.println("Eisigage ta akolou8a"); break; } } %> <form action="registerController.jsp" method="POST"> Name : <input type="text" length=10 name="name" value="<%= name %>"> <br> Email : <input type="text" length=10 name="email" value="<%= email %>"> <br> Password : <input type="password" length=10 name="password" value=""> <br> Re-Password : <input type="password" length=10 name="repassword" value=""> <br> <input type=submit value="register"> </form> </body> </html>
Java datei
package registerBean; public class registerBean //extends MySQLInterface { private String userName; private String password; private String passwordReapeat; private String email; final static public int ALLOK = 0; final static public int EMPTY = 1; final static public int PASSWORDMISSMATCH = 2; final static public int USEREXIST = 3; final static public int DBERROR = 4; public static void main() { } public String getUserName() { return this.userName; } public String getPassword() { return this.password; } public String getPasswordRepeat() { return this.passwordReapeat; } public String getEmail() { return this.email; } public void setUserName(String setUserName) { this.userName = setUserName; } public void setPassword(String setPassword) { this.password = setPassword; } public void setPasswordRepeat(String setPasswordRepeat) { this.passwordReapeat = setPasswordRepeat; } public void setEmail(String SetEmail) { this.email = SetEmail; } private boolean checkDataBase() { String Hash[] = new String[1]; String Colums[] = new String[1]; Hash[0] = this.getUserName(); //Colums[0] = this.GetTable(); return true;//this.SQLCheckExist(Hash, Colums); } public void setupDatabase(String Driver, String Url, String Table, String User, String PassWord) { //this.Init(Driver, Url, Table, User, PassWord); } public int getStatus() { String Insert[] = new String[3]; if(this.getUserName().length() == 0) { return EMPTY; } if(this.getEmail().length() == 0) { return EMPTY; } if(this.getPassword().length() == 0) { return EMPTY; } if(this.getPasswordRepeat().length() == 0) { return EMPTY; } if(this.getPassword().equals(this.getPasswordRepeat())) { return PASSWORDMISSMATCH; } Insert[0] = this.getUserName(); Insert[1] = this.getEmail(); Insert[2] = this.getEmail(); if(this.checkDataBase()) { //if(this.SQLInsertInTable(this.GetTable(), Insert)) //{ return DBERROR; //} } return ALLOK; } }
weis einer rat sitz jetz 2 tage und probiere aber find nicht wiso das nicht funktioniert
-
Befindet sich die Bean an der richtigen Stelle? Habe ich zwar lange nicht gemacht, aber ich glaube, die Bean-Klasse sollte sich hier befinden: /WEB-INF/classes/registerBean
Ganz nebenbei würde ich Klassennamen immer großschreiben!