Package javax.servlet

Examples of javax.servlet.ServletRequestAttributeEvent


                      Object av = hreq
                          .getAttribute((String) args[0]);
                      hreq.setAttribute((String) args[0],
                          args[1]);
                      if (av == null) {
                        ServletRequestAttributeEvent e = new ServletRequestAttributeEvent(
                            WebAppServlet.this,
                            hreq, (String) args[0],
                            args[1]);
                        for (ServletRequestAttributeListener sarl : attributeListeners)
                          sarl.attributeAdded(e);
                      } else {
                        ServletRequestAttributeEvent e = new ServletRequestAttributeEvent(
                            WebAppServlet.this,
                            hreq, (String) args[0],
                            av);
                        for (ServletRequestAttributeListener sarl : attributeListeners)
                          sarl.attributeReplaced(e);
                      }
                      return null;
                    } else if (mn.equals("removeAttribute")) {
                      Object av = hreq
                          .getAttribute((String) args[0]);
                      hreq.removeAttribute((String) args[0]);
                      ServletRequestAttributeEvent e = new ServletRequestAttributeEvent(
                          WebAppServlet.this, hreq,
                          (String) args[0], av);
                      for (ServletRequestAttributeListener sarl : attributeListeners)
                        sarl.attributeRemoved(e);
                      return null;
View Full Code Here


       
        if (old_value!=null)
        {
            if (_requestAttributeListeners!=null)
            {
                final ServletRequestAttributeEvent event =
                    new ServletRequestAttributeEvent(_context,this,name, old_value);
                final int size=LazyList.size(_requestAttributeListeners);
                for(int i=0;i<size;i++)
                {
                    final EventListener listener = (ServletRequestAttributeListener)LazyList.get(_requestAttributeListeners,i);
                    if (listener instanceof ServletRequestAttributeListener)
View Full Code Here

            _attributes=new AttributesMap();
        _attributes.setAttribute(name, value);
       
        if (_requestAttributeListeners!=null)
        {
            final ServletRequestAttributeEvent event =
                new ServletRequestAttributeEvent(_context,this,name, old_value==null?value:old_value);
            final int size=LazyList.size(_requestAttributeListeners);
            for(int i=0;i<size;i++)
            {
                final EventListener listener = (ServletRequestAttributeListener)LazyList.get(_requestAttributeListeners,i);
                if (listener instanceof ServletRequestAttributeListener)
View Full Code Here

    this.context = context;
    this.listener = listener;
  }

  private ServletRequestAttributeEvent createEvent(String name, Object value) {
    return new ServletRequestAttributeEvent(context, this, name, value);
  }
View Full Code Here

        Object listeners[] = context.getApplicationEventListeners();
        if ((listeners == null) || (listeners.length == 0)) {
            return;
        }
        boolean replaced = (oldValue != null);
        ServletRequestAttributeEvent event = null;
        if (replaced) {
            event = new ServletRequestAttributeEvent(
                    context.getServletContext(), getRequest(), name, oldValue);
        } else {
            event = new ServletRequestAttributeEvent(
                    context.getServletContext(), getRequest(), name, value);
        }

        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletRequestAttributeListener)) {
View Full Code Here

    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;
            }
View Full Code Here

        Object listeners[] = context.getApplicationEventListeners();
        if ((listeners == null) || (listeners.length == 0)) {
            return;
        }
        boolean replaced = (oldValue != null);
        ServletRequestAttributeEvent event = null;
        if (replaced) {
            event = new ServletRequestAttributeEvent(
                    context.getServletContext(), getRequest(), name, oldValue);
        } else {
            event = new ServletRequestAttributeEvent(
                    context.getServletContext(), getRequest(), name, value);
        }

        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletRequestAttributeListener)) {
View Full Code Here

    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;
            }
View Full Code Here

        Object listeners[] = context.getApplicationEventListeners();
        if ((listeners == null) || (listeners.length == 0)) {
            return;
        }
        boolean replaced = (oldValue != null);
        ServletRequestAttributeEvent event = null;
        if (replaced) {
            event = new ServletRequestAttributeEvent(
                    context.getServletContext(), getRequest(), name, oldValue);
        } else {
            event = new ServletRequestAttributeEvent(
                    context.getServletContext(), getRequest(), name, value);
        }

        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletRequestAttributeListener)) {
View Full Code Here

    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;
            }
View Full Code Here

TOP

Related Classes of javax.servlet.ServletRequestAttributeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.