[opencms-dev] loginBean throws Nullpointer Exception
Christoph P. Kukulies
kuku at physik.rwth-aachen.de
Thu Apr 26 15:23:00 CEST 2007
My logout.jsp contains the following code:
<%@ page session="false" import="java.util.*,org.opencms.jsp.*" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<jsp:useBean id="loginBean" class="org.opencms.jsp.CmsJspLoginBean">
<%
CmsJspActionElement jsp = new CmsJspActionElement(pageContext,
request,response);
if(loginBean!=null) {
if(loginBean.isLoggedIn()) {
loginBean.logout();
//response.sendRedirect("/de/misc/thanksforvisiting.htm");
}
} // else {
// response.sendRedirect("/de/misc/cannotlogout.htm");
// }
%>
</jsp:useBean>
By my understanding, the loginBean is created and init()ed once in
my login.jsp:
<jsp:useBean id="loginBean" class="org.opencms.jsp.CmsJspLoginBean">
<%
loginBean.init(pageContext,request,response);
if(request.getParameter("username")!= null){
loginBean.login(request.getParameter("username"),request.getParameter("password"),null,
request.getParameter("requestedResource"));
out.write("Username: "+request.getParameter("username"));
}
%>
</jsp:useBean>
Can I refer that bean (by Id) in another jsp? I thought so.
--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
More information about the opencms-dev
mailing list