Accessing Java EE Scope Objects"

From Documentation
 
Line 21: Line 21:
 
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Sessions.html org.zkoss.zk.ui.Sessions]
 
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Sessions.html org.zkoss.zk.ui.Sessions]
  
==getCurrent==
+
==Get Current Session ==
 
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Sessions.html#getCurrent() Sessions.getCurrent()]
 
[http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zk/ui/Sessions.html#getCurrent() Sessions.getCurrent()]
  
Retrieves the current session.
+
Retrieves the current ZK-wrapped session.
 +
 
 +
== Get HttpSession ==
 +
<syntaxhighlight lang="java">
 +
HttpSession nativeSession = (HttpSession) Sessions.getCurrent().getNativeSession();
 +
</syntaxhighlight>
  
 
{{ZKDevelopersReferencePageFooter}}
 
{{ZKDevelopersReferencePageFooter}}

Latest revision as of 06:12, 1 February 2024


Accessing Java EE Scope Objects



Executions

org.zkoss.zk.ui.Executions

getCurrent

Executions.getCurrent()

Retrieves the current execution which contains HTTP request/response.


get HttpServletRequest

HttpServletRequest req = (HttpServletRequest)Executions.getCurrent().getNativeRequest()

getNativeRequest()

Sessions

org.zkoss.zk.ui.Sessions

Get Current Session

Sessions.getCurrent()

Retrieves the current ZK-wrapped session.

Get HttpSession

HttpSession nativeSession = (HttpSession) Sessions.getCurrent().getNativeSession();



Last Update : 2024/02/01

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.