All blog posts, code samples and downloads licensed under Apache License 2.0.
Close

Get handles to Notes objects within your own bean class

Oliver Busse on 03/07/2013 14:18:33 CET, filed under Java 

Nothing to say about it, just get e.g. the current session (Notes user data and credentials incl.) for your own bean classes.

package com.beans;

import javax.faces.context.FacesContext;

import lotus.domino.Session;
public class MyBeanClass {
	
	public MyBeanClass() {
	
	}
	
	// retrieve handle to a Notes-Domino object in the bean class
	public static Session getCurrentSession() {
		FacesContext context = FacesContext.getCurrentInstance();
		return (Session) context.getApplication().getVariableResolver()
				.resolveVariable(context, "session");
	}
}

Tagged with bean session class