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


Java ServletRequestAttributeListener.attributeRemoved方法代码示例

本文整理汇总了Java中javax.servlet.ServletRequestAttributeListener.attributeRemoved方法的典型用法代码示例。如果您正苦于以下问题:Java ServletRequestAttributeListener.attributeRemoved方法的具体用法?Java ServletRequestAttributeListener.attributeRemoved怎么用?Java ServletRequestAttributeListener.attributeRemoved使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.ServletRequestAttributeListener的用法示例。


在下文中一共展示了ServletRequestAttributeListener.attributeRemoved方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notifyAttributeRemoved

import javax.servlet.ServletRequestAttributeListener; //导入方法依赖的package包/类
/**
 * Notify interested listeners that attribute has been removed.
 */
private void notifyAttributeRemoved(String name, Object value) {
    Object listeners[] = context.getApplicationEventListeners();
    if ((listeners == null) || (listeners.length == 0)) {
        return;
    }
    ServletRequestAttributeEvent event =
      new ServletRequestAttributeEvent(context.getServletContext(),
                                       getRequest(), name, value);
    for (int i = 0; i < listeners.length; i++) {
        if (!(listeners[i] instanceof ServletRequestAttributeListener)) {
            continue;
        }
        ServletRequestAttributeListener listener =
            (ServletRequestAttributeListener) listeners[i];
        try {
            listener.attributeRemoved(event);
        } catch (Throwable t) {
            ExceptionUtils.handleThrowable(t);
            context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
            // Error valve will pick this exception up and display it to user
            attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:28,代码来源:Request.java

示例2: notifyAttributeRemoved

import javax.servlet.ServletRequestAttributeListener; //导入方法依赖的package包/类
/**
 * Notify interested listeners that attribute has been removed.
 */
private void notifyAttributeRemoved(String name, Object value) {
	Object listeners[] = context.getApplicationEventListeners();
	if ((listeners == null) || (listeners.length == 0)) {
		return;
	}
	ServletRequestAttributeEvent event = new ServletRequestAttributeEvent(context.getServletContext(), getRequest(),
			name, value);
	for (int i = 0; i < listeners.length; i++) {
		if (!(listeners[i] instanceof ServletRequestAttributeListener)) {
			continue;
		}
		ServletRequestAttributeListener listener = (ServletRequestAttributeListener) listeners[i];
		try {
			listener.attributeRemoved(event);
		} catch (Throwable t) {
			ExceptionUtils.handleThrowable(t);
			context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
			// Error valve will pick this exception up and display it to
			// user
			attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:27,代码来源:Request.java

示例3: removeAttribute

import javax.servlet.ServletRequestAttributeListener; //导入方法依赖的package包/类
/**
 * Remove the specified request attribute if it exists.
 *
 * @param name Name of the request attribute to remove
 */
public void removeAttribute(String name) {
    Object value = null;
    boolean found = false;

    // Remove the specified attribute
    // Check for read only attribute
    // requests are per thread so synchronization unnecessary
    if (readOnlyAttributes.containsKey(name)) {
        return;
    }

    // Pass special attributes to the native layer
    if (name.startsWith("org.apache.tomcat.")) {
        coyoteRequest.getAttributes().remove(name);
    }

    found = attributes.containsKey(name);
    if (found) {
        value = attributes.get(name);
        attributes.remove(name);
    } else {
        return;
    }
    
    // Notify interested application event listeners
    Object listeners[] = context.getApplicationEventListeners();
    if ((listeners == null) || (listeners.length == 0))
        return;
    ServletRequestAttributeEvent event =
      new ServletRequestAttributeEvent(context.getServletContext(),
                                       getRequest(), name, value);
    for (int i = 0; i < listeners.length; i++) {
        if (!(listeners[i] instanceof ServletRequestAttributeListener))
            continue;
        ServletRequestAttributeListener listener =
            (ServletRequestAttributeListener) listeners[i];
        try {
            listener.attributeRemoved(event);
        } catch (Throwable t) {
            context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
            // Error valve will pick this execption up and display it to user
            attributes.put( Globals.EXCEPTION_ATTR, t );
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:51,代码来源:Request.java

示例4: attributeRemoved

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

示例5: removeAttribute

import javax.servlet.ServletRequestAttributeListener; //导入方法依赖的package包/类
/**
 * Remove the specified request attribute if it exists.
 *
 * @param name Name of the request attribute to remove
 */
@Override
public void removeAttribute(String name) {
    Object value = null;
    boolean found = false;

    // Remove the specified attribute
    // Check for read only attribute
    // requests are per thread so synchronization unnecessary
    if (readOnlyAttributes.containsKey(name)) {
        return;
    }

    // Pass special attributes to the native layer
    if (name.startsWith("org.apache.tomcat.")) {
        coyoteRequest.getAttributes().remove(name);
    }

    found = attributes.containsKey(name);
    if (found) {
        value = attributes.get(name);
        attributes.remove(name);
    } else {
        return;
    }
    
    // Notify interested application event listeners
    Object listeners[] = context.getApplicationEventListeners();
    if ((listeners == null) || (listeners.length == 0))
        return;
    ServletRequestAttributeEvent event =
      new ServletRequestAttributeEvent(context.getServletContext(),
                                       getRequest(), name, value);
    for (int i = 0; i < listeners.length; i++) {
        if (!(listeners[i] instanceof ServletRequestAttributeListener))
            continue;
        ServletRequestAttributeListener listener =
            (ServletRequestAttributeListener) listeners[i];
        try {
            listener.attributeRemoved(event);
        } catch (Throwable t) {
            ExceptionUtils.handleThrowable(t);
            context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
            // Error valve will pick this exception up and display it to user
            attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
        }
    }
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:53,代码来源:Request.java


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