//
WebuiApplication app = (WebuiApplication) context.getApplication();
//
ApplicationState appState = null;
HttpSession session = getSession(context);
String key = getKey(context);
if (session != null) {
appState = (ApplicationState) session.getAttribute(APPLICATION_ATTRIBUTE_PREFIX + key);
}
UIApplication uiapp = null;
if (appState != null) {
if (log.isDebugEnabled()) {
log.debug("Found application " + key + " :" + appState.getApplication());
}
if (Safe.equals(context.getRemoteUser(), appState.getUserName())) {
uiapp = appState.getApplication();
}
} else {
log.debug("Application " + key + " not found");
}