[opencms-dev] Web User Authentication Failing

Millo Magnocavallo millo_magno at yahoo.com
Wed Sep 15 20:42:35 CEST 2004


Hi,

I've got my registration page working and saving data to the db using
CmsObject.addWebUser() method but I'm having problems with the page
which authenticates user logins. I've cut the code down to the very
basic in order to test and also to demonstrate here but it seems that
it's the cmsObj.loginWebUser(user,pass) method which keeps throwing a
nullpointer exception but i don't know why. Can anyone give me any
clues? Here is the code with hardcode values for testing: 

<%@ page session="false" %>
<%
	com.opencms.flex.jsp.CmsJspActionElement cmsJspAE = new
com.opencms.flex.jsp.CmsJspActionElement(pageContext, request,
response);
	com.opencms.file.CmsObject cmsObj = new com.opencms.file.CmsObject();
	
	// hard coded - these values definitely exist in db
	String user = "johnny"; 
	String pass = "johnny";
	
	if (request.getMethod().equals("POST")) {
		try {
			cmsObj.loginWebUser(user,pass);
		} catch (com.opencms.core.CmsException cmsE) {
			out.print(cmsE.getMessage());
		}
	}
%>

Any help appreciated,
Thanks,
Millo






More information about the opencms-dev mailing list