src/main/java/js/servlet/SessionScopeFactory.java
@Override
	public void persistInstance(InstanceKey instanceKey, Object instance) {
		// at this point key and instance arguments are guaranteed to be non null

		HttpSession httpSession = getSession(instanceKey);
		httpSession.setAttribute(instanceKey.getValue(), instance);
	}
@Override
	public void persistInstance(InstanceKey instanceKey, Object instance) {
		// at this point key and instance arguments are guaranteed to be non null

		HttpSession httpSession = getSession(instanceKey);
		httpSession.setAttribute(instanceKey.getValue(), instance);
	}
@ Override public void persistInstance ( InstanceKey instanceKey , Object instance ) { // at this point key and instance arguments are guaranteed to be non null
 HttpSession httpSession = getSession ( instanceKey ) ; httpSession . setAttribute ( instanceKey . getValue ( ) , instance ) ; }
Persist instance on current HTTP session, bound to given managed instance key. This method simply uses
<code>instanceKey</code> to add instance as HTTP session attribute. Both arguments should to be not null.
<p>
Access to HTTP session is obtained from HTTP request; therefore, it is considered a bug if attempt to use this method
outside a HTTP request thread.
<p>
Implementation note: this method could have side effect. It <b>creates the HTTP session</b> if there is none on current
HTTP request.

@param instanceKey managed instance key,
@param instance managed instance.
@throws BugError if attempt to use this method outside a HTTP request.
Persist instance on current HTTP session bound to given managed instance key . This method simply uses <code > instanceKey< / code > to add instance as HTTP session attribute . Both arguments should to be not null . <p > Access to HTTP session is obtained from HTTP request ; therefore it is considered a bug if attempt to use this method outside a HTTP request thread . <p > Implementation note : this method could have side effect . It <b > creates the HTTP session< / b > if there is none on current HTTP request .