07-13-2007 06:16 PM
protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String ticket = login(request);
logger.debug("login ticket = "+ticket);
AuthenticationStatus status = AuthenticationHelper.authenticate(getServletContext(), request, response, ticket);
if (status == AuthenticationStatus.Failure)
{
return;
}
processRequest(request, response, false);
}
public String login(HttpServletRequest httpRequest)
{
String ticket = null;
HttpSession session = httpRequest.getSession();
ticket = (String)session.getAttribute(SESSION_USER_TICKET);
FacesContext fc = FacesContext.getCurrentInstance();
ServiceRegistry serviceRegistry = getServiceRegistry(getServletContext());
AuthenticationService authenticationService = serviceRegistry.getAuthenticationService();
try
{
authenticationService.authenticate("admin", "admin".toCharArray());
ticket = authenticationService.getCurrentTicket();
session.setAttribute(SESSION_USER_TICKET, ticket);
}
catch (AuthenticationException aerr)
{
Utils.addErrorMessage(Application.getMessage(fc, MSG_ERROR_UNKNOWN_USER));
}
catch (InvalidNodeRefException refErr)
{
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(fc,
Repository.ERROR_NOHOME), refErr.getNodeRef().getId()));
}
return ticket;
}
java.lang.NullPointerException
at org.springframework.web.jsf.FacesContextUtils.getWebApplicationContex
t(FacesContextUtils.java:47)
at org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicati
onContext(FacesContextUtils.java:77)
at org.alfresco.web.bean.repository.Repository.getServiceRegistry(Reposi
tory.java:410)
at org.alfresco.web.bean.repository.Node.getServiceRegistry(Node.java:50
0)
at org.alfresco.web.bean.repository.Node.<init>(Node.java:95)
at com.tlhc.wc.servlet.PageProcessor.processTemplateRequest(PageProcesso
r.java:146)
at com.tlhc.wc.servlet.PageProcessor.service(PageProcessor.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
…
07-16-2007 09:29 AM
07-16-2007 10:49 AM
Node myNode = new Node(myNodeRef);
07-17-2007 06:49 AM
07-17-2007 09:48 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.