您好,我正在使用jsp在glassfish上开发一个站点,以使用Java bean管理会话,但是当我调用loginbean.jsp时,我从glassfish中收到一条错误消息,说Controller软件包不存在?怎么可能?
User.java
public class User implements Serializable {
protected int IdUser;
protected String Nome, Cognome, Username, Password,Email;
//Metodo di Login
public Boolean Login(String Email,String Username, String Password) {
if (Username.length() > 0 && Password.length() > 0) {
int ret = UserModel.Login(Email,Username, Password);
if (ret > 0) {
this.Username = Username;
this.Password = Password;
this.Email=Email;
this.IdUser = ret;
return true;
}
}
return false;
}
loginbean.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page errorPage = "errorPage.jsp" %>
<jsp:useBean id="User" class="Controller.User" scope="session" />
<jsp:setProperty name="User" property="*" />
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
</head>
<body>
<%
session.setMaxInactiveInterval(1800); // 30 minute time out
if (User.Login(request.getParameter("email"), "", request.getParameter("password"))) {
out.println("You are logged");
} else {
out.println("Invalid login<br />");
}
%>
</body>
</html>
项目目录:
Project
-------Controller
---User.java
loginbean.jsp
玻璃鱼异常:
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP
PWC6197: An error occurred at line: 3 in the jsp file: /loginbean.jsp
PWC6199: Generated servlet error:
package Controller does not exist