本文整理汇总了Java中javax.servlet.ServletRequestListener.requestInitialized方法的典型用法代码示例。如果您正苦于以下问题:Java ServletRequestListener.requestInitialized方法的具体用法?Java ServletRequestListener.requestInitialized怎么用?Java ServletRequestListener.requestInitialized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.servlet.ServletRequestListener
的用法示例。
在下文中一共展示了ServletRequestListener.requestInitialized方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fireRequestInitEvent
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
@Override
public boolean fireRequestInitEvent(ServletRequest request) {
Object instances[] = getApplicationEventListeners();
if ((instances != null) && (instances.length > 0)) {
ServletRequestEvent event =
new ServletRequestEvent(getServletContext(), request);
for (int i = 0; i < instances.length; i++) {
if (instances[i] == null)
continue;
if (!(instances[i] instanceof ServletRequestListener))
continue;
ServletRequestListener listener =
(ServletRequestListener) instances[i];
try {
listener.requestInitialized(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
getLogger().error(sm.getString(
"standardContext.requestListener.requestInit",
instances[i].getClass().getName()), t);
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
return false;
}
}
}
return true;
}
示例2: fireRequestInitEvent
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
@Override
public boolean fireRequestInitEvent(ServletRequest request) {
Object instances[] = getApplicationEventListeners();
if ((instances != null) && (instances.length > 0)) {
ServletRequestEvent event = new ServletRequestEvent(getServletContext(), request);
for (int i = 0; i < instances.length; i++) {
if (instances[i] == null)
continue;
if (!(instances[i] instanceof ServletRequestListener))
continue;
ServletRequestListener listener = (ServletRequestListener) instances[i];
try {
listener.requestInitialized(event);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
getLogger().error(sm.getString("standardContext.requestListener.requestInit",
instances[i].getClass().getName()), t);
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
return false;
}
}
}
return true;
}
示例3: requestInitialized
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
@Override
public void requestInitialized(ServletRequestEvent event) {
requestContextListener.requestInitialized(event);
for (ServletRequestListener requestListener : HANDLER.requestListeners) {
HANDLER.executeInjection(requestListener);
requestListener.requestInitialized(event);
}
}
示例4: ensureRequestScope
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
public static void ensureRequestScope(final ContextsService cs, final ServletRequestListener listener) {
final Context reqCtx = cs.getCurrentContext(RequestScoped.class);
if (reqCtx == null || !cs.getCurrentContext(RequestScoped.class).isActive()) {
listener.requestInitialized(null);
FAKE_REQUEST.set(true);
}
}
示例5: init
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
public void init() {
if (begin != null && getAttribute("openejb_requestInitialized") == null) {
setAttribute("openejb_requestInitialized", "ok"); // if called again we loose the request scope
begin.requestInitialized(new ServletRequestEvent(getServletContext(), this));
}
listeners = LightweightWebAppBuilderListenerExtractor.findByTypeForContext(contextPath, ServletRequestListener.class);
if (!listeners.isEmpty()) {
final ServletRequestEvent event = new ServletRequestEvent(getServletContext(), this);
for (final ServletRequestListener listener : listeners) {
listener.requestInitialized(event);
}
}
}
示例6: requestInitialized
import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
public void requestInitialized(ServletRequestEvent sre) {
for (ServletRequestListener listener : listeners) {
listener.requestInitialized(sre);
}
}