Package org.zkoss.zk.ui
Class WebApps
- java.lang.Object
-
- org.zkoss.zk.ui.WebApps
-
- Direct Known Subclasses:
WebAppsCtrl
public class WebApps extends java.lang.Object
Utilities related to the Web application.- Since:
- 3.0.7
- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description WebApps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WebApp
getCurrent()
Returns this Web application, or null if not available.static java.lang.String
getEdition()
Returns the edition, such as EE, PE and CE.static boolean
getFeature(java.lang.String feature)
Returns whether the specified feature is supported.
-
-
-
Field Detail
-
_wapp
protected static WebApp _wapp
The application for the whole installation. It assumes ZK libraries are not shared, i.e., installed underWEB-INF/lib
.- Since:
- 5.0.9
-
-
Method Detail
-
getCurrent
public static WebApp getCurrent()
Returns this Web application, or null if not available.Notice that this method is useful only if ZK libraries are NOT shared by multiple Web application (in other words, they are installed under
WEB-INF/lib
). If you share ZK libraries among multiple applications (such as installing them undershared/lib
), the returned instance could be any of them.If you share ZK libraries among multiple applications, you could retrieve the current Web application by one of the following depending your context.
- In an event listener:
Sessions.getCurrent(false).getWebApp();
Note, sinceSessions.getCurrent(boolean)
returns null if it executes in a working thread (withoutExecution
). - In a working thread (not current execution):
WebManager.getWebManager(servletContext).getWebApp();
As shown above,WebManager.getWebManager(javax.servlet.ServletContext)
requires a servlet context.
- Since:
- 5.0.9
- In an event listener:
-
getFeature
public static boolean getFeature(java.lang.String feature)
Returns whether the specified feature is supported.- Parameters:
feature
- which feature to check. Supported features:professional
orpe
- Whether it is ZK PE, i.e., whether zkex.jar (and others) are installed.
enterprise
oree
- Whether it is ZK EE, i.e., whether zkmax.jar (and others) are installed. Note: ZK EE implies "pe". In other words, if getFeature("ee") is true, getFeature("pe") must be true.
- Since:
- 3.0.7
-
getEdition
public static java.lang.String getEdition()
Returns the edition, such as EE, PE and CE. Notice that prior to 5.0.1, the return value is one of Enterprise, Professional and Standard.- Since:
- 3.6.2
-
-