当前位置: 首页>>代码示例>>Java>>正文


Java ServletRequestListener.requestInitialized方法代码示例

本文整理汇总了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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:33,代码来源:StandardContext.java

示例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;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:30,代码来源:StandardContext.java

示例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);
    }
}
 
开发者ID:jefalbino,项目名称:jsmart-web,代码行数:10,代码来源:RequestControl.java

示例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);
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:8,代码来源:WebBeansListenerHelper.java

示例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);
        }
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:15,代码来源:HttpRequestImpl.java

示例6: requestInitialized

import javax.servlet.ServletRequestListener; //导入方法依赖的package包/类
public void requestInitialized(ServletRequestEvent sre) {
  for (ServletRequestListener listener : listeners) {
    listener.requestInitialized(sre);
  }
}
 
开发者ID:bboypscmylife,项目名称:opengse,代码行数:6,代码来源:ServletRequestListenerList.java


注:本文中的javax.servlet.ServletRequestListener.requestInitialized方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。