这是我收到的错误,
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 13 in the jsp file: /index.jsp
Cannot cast from Object to boolean
这是我的代码:
控制器小服务程序
if(authentication.verifyCredentials(request.getParameter("username"),
request.getParameter("password")))
{
session.setAttribute("username", request.getParameter("username"));
session.setAttribute("loggedIn", true);
dispatcher.forward(request, response);
}
这个我也试过
session.setAttribute("loggedIn", new Boolean(true));
JSP
<%
if(session.getAttribute("loggedIn") != null)
{
if(((boolean)session.getAttribute("loggedIn")))
{
response.sendRedirect("Controller");
}
}
%>
是的,我进行了研究,也看到了以前的 stackoverflow帖子;但是我仍然无法解决我的问题。请协助。