
<< ADD DESCRIPTION HERE >>


SECTION: Modified Files
----------------------------
M      jsf-api/src/javax/faces/event/AfterAddToParentEvent.java
M      jsf-api/src/javax/faces/event/AfterAddToViewEvent.java
M      jsf-ri/test/com/sun/faces/annotation/TestAnnotatedComponents.java
M      jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/CoreLibrary.java
M      jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java
M      jsf-ri/src/com/sun/faces/application/annotation/AnnotationManager.java
M      jsf-ri/src/com/sun/faces/config/AnnotationScanner.java
M      jsf-ri/systest/web/WEB-INF/faces-config.xml
M      jsf-ri/systest/web/WEB-INF/web.xml
M      jsf-ri/systest/build-tests.xml


A      jsf-api/src/javax/faces/event/NamedEvent.java
A      jsf-ri/test/com/sun/faces/annotation/AnnotatedComponentSystemEvent.java
A      jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/EventHandler.java
A      jsf-ri/src/com/sun/faces/application/NamedEventManager.java
A      jsf-ri/src/com/sun/faces/application/annotation/NamedEventConfigHandler.java
A      jsf-ri/systest/src/com/sun/faces/systest/model/EventTagBean.java
A      jsf-ri/systest/web/eventTag.xhtml
A      jsf-ri/systest/web/eventTagInvalid.xhtml


SECTION: Diffs
----------------------------
Index: jsf-api/src/javax/faces/event/AfterAddToParentEvent.java
===================================================================
--- jsf-api/src/javax/faces/event/AfterAddToParentEvent.java	(revision 6134)
+++ jsf-api/src/javax/faces/event/AfterAddToParentEvent.java	(working copy)
@@ -5,7 +5,6 @@
 
 package javax.faces.event;
 
-import java.util.Map;
 import javax.faces.component.UIComponent;
 
 /**
Index: jsf-api/src/javax/faces/event/AfterAddToViewEvent.java
===================================================================
--- jsf-api/src/javax/faces/event/AfterAddToViewEvent.java	(revision 6134)
+++ jsf-api/src/javax/faces/event/AfterAddToViewEvent.java	(working copy)
@@ -36,7 +36,6 @@
 
 package javax.faces.event;
 
-import java.util.Map;
 import javax.faces.component.UIComponent;
 
 /**
Index: jsf-api/src/javax/faces/event/NamedEvent.java
===================================================================
--- jsf-api/src/javax/faces/event/NamedEvent.java	(revision 0)
+++ jsf-api/src/javax/faces/event/NamedEvent.java	(revision 0)
@@ -0,0 +1,81 @@
+/*
+ * $Id: Renderer.java,v 1.39.12.7 2008/04/17 18:51:29 edburns Exp $
+ */
+
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License").  You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code.  If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license."  If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above.  However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package javax.faces.event;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.Inherited;
+
+
+/**
+ * <p class="changed_added_2_0">The presence of this annotation on a
+ * class automatically registers the class with the runtime as a {@link
+ * ComponentSystemEvent}.  The value of the {@link #shortName} attribute is taken to
+ * be the shor name for the {@link javax.faces.event.ComponentSystemEvent}.
+ * The implementation must guarantee that for
+ * each class annotated with <code>NamedEvent</code>, found with the
+ * scanning algorithm at "<em><a target="_"
+ * href="../application/FacesAnnotationHandler.html#configAnnotationScanningSpecification">configAnnotationScanningSpecification</a></em>",
+ * the {@link javax.faces.event.ComponentSystemEvent} must registered with the runtime.
+ * If the shortName has already been registered, the current class must be added to a
+ * List of of duplicate Events for that name.  If the event name is then reference by an
+ * application, an Exception must thrown listing the shortName and the offending classes.</p>
+ */
+
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface NamedEvent {
+
+    /**
+     * <p class="changed_added_2_0">The value of this annotation
+     * attribute is taken to be the short name for the  {@link
+     * javax.faces.event.ComponentSystemEvent}</p>
+     */
+
+    String shortName() default "";
+
+
+}
Index: jsf-ri/test/com/sun/faces/annotation/TestAnnotatedComponents.java
===================================================================
--- jsf-ri/test/com/sun/faces/annotation/TestAnnotatedComponents.java	(revision 6134)
+++ jsf-ri/test/com/sun/faces/annotation/TestAnnotatedComponents.java	(working copy)
@@ -50,6 +50,7 @@
 
 import com.sun.faces.cactus.ServletFacesTestCase;
 import com.sun.faces.application.ApplicationAssociate;
+import com.sun.faces.application.NamedEventManager;
 import com.sun.faces.mgbean.BeanManager;
 import com.sun.faces.mgbean.ManagedBeanInfo;
 import com.sun.faces.mgbean.BeanBuilder;
@@ -213,5 +214,10 @@
         assertNotNull(r);
         assertTrue(r.getClass().getName().endsWith("AnnotatedRenderer2"));
 
+        // Test default naming logic
+        assertNotNull(ApplicationAssociate.getInstance(ctx.getExternalContext()).getNamedEventManager().getNamedEvent("com.sun.faces.annotation.annotatedComponentSystem"));
+        // Test short name
+        assertNotNull(ApplicationAssociate.getInstance(ctx.getExternalContext()).getNamedEventManager().getNamedEvent("com.sun.faces.annotation.anotherAnnotatedComponentSystem"));
+        assertNotNull(ApplicationAssociate.getInstance(ctx.getExternalContext()).getNamedEventManager().getNamedEvent("explicitEventName"));
     }
 }
Index: jsf-ri/test/com/sun/faces/annotation/AnnotatedComponentSystemEvent.java
===================================================================
--- jsf-ri/test/com/sun/faces/annotation/AnnotatedComponentSystemEvent.java	(revision 0)
+++ jsf-ri/test/com/sun/faces/annotation/AnnotatedComponentSystemEvent.java	(revision 0)
@@ -0,0 +1,21 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.sun.faces.annotation;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.NamedEvent;
+
+/**
+ *
+ */
+@NamedEvent
+public class AnnotatedComponentSystemEvent extends ComponentSystemEvent {
+    public AnnotatedComponentSystemEvent(UIComponent component) {
+        super(component);
+    }
+
+}
Index: jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/CoreLibrary.java
===================================================================
--- jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/CoreLibrary.java	(revision 6134)
+++ jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/CoreLibrary.java	(working copy)
@@ -92,6 +92,8 @@
 
         this.addConverter("converter", null, ConvertDelegateHandler.class);
 
+        this.addTagHandler("event", EventHandler.class);
+
         this.addTagHandler("facet", FacetHandler.class);
 
         this.addTagHandler("loadBundle", LoadBundleHandler.class);
Index: jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/EventHandler.java
===================================================================
--- jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/EventHandler.java	(revision 0)
+++ jsf-ri/src/com/sun/faces/facelets/tag/jsf/core/EventHandler.java	(revision 0)
@@ -0,0 +1,86 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.sun.faces.facelets.tag.jsf.core;
+
+import com.sun.faces.application.ApplicationAssociate;
+import com.sun.faces.application.NamedEventManager;
+import com.sun.faces.util.Util;
+import java.io.IOException;
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ComponentSystemEventListener;
+import javax.faces.event.SystemEvent;
+import javax.faces.webapp.pdl.facelets.FaceletContext;
+import javax.faces.webapp.pdl.facelets.FaceletException;
+import javax.faces.webapp.pdl.facelets.tag.TagAttribute;
+import javax.faces.webapp.pdl.facelets.tag.TagConfig;
+import javax.faces.webapp.pdl.facelets.tag.TagHandler;
+
+/**
+ * This is the TagHandler for the f:event tag.
+ */
+public class EventHandler extends TagHandler {
+    protected final TagAttribute type;
+    protected final TagAttribute target;
+
+    public EventHandler(TagConfig config) {
+        super(config);
+        this.type = this.getRequiredAttribute("type");
+        this.target = this.getRequiredAttribute("target");
+    }
+
+    public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException {
+        Class<? extends SystemEvent> eventClass = getEventClass(ctx);
+        if (eventClass != null) {
+            parent.subscribeToEvent(eventClass,
+                    new DeclarativeSystemEventListener(ctx.getFacesContext().getELContext(),
+                    target.getMethodExpression(ctx, Object.class, new Class[] { ComponentSystemEvent.class })));
+        }
+    }
+
+    protected Class<? extends SystemEvent> getEventClass(FaceletContext ctx) {
+        Class<? extends SystemEvent> clazz = null;
+        String eventType = (String) this.type.getValueExpression(ctx, String.class).getValue(ctx);
+        if (eventType == null) {
+            throw new FacesException("Attribute 'type' can not be null");
+        }
+        ApplicationAssociate associate =
+                  ApplicationAssociate.getInstance(ctx.getFacesContext().getExternalContext());
+        NamedEventManager nem = associate.getNamedEventManager();
+
+        clazz = nem.getNamedEvent(eventType);
+        if (clazz == null) {
+            try {
+                clazz = Util.loadClass(eventType, this);
+            } catch (ClassNotFoundException ex) {
+                throw new FacesException ("An unknown event type was specified:  " + eventType);
+            }
+        }
+
+        return clazz;
+    }
+
+}
+
+
+class DeclarativeSystemEventListener implements ComponentSystemEventListener {
+
+    private ELContext elContext;
+    private MethodExpression target;
+
+    public DeclarativeSystemEventListener(ELContext elContext, MethodExpression target) {
+        this.elContext = elContext;
+        this.target = target;
+    }
+
+    public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
+        target.invoke(elContext, new Object[]{event});
+    }
+}
\ No newline at end of file
Index: jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java
===================================================================
--- jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java	(revision 6134)
+++ jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java	(working copy)
@@ -172,6 +172,8 @@
 
     private PropertyEditorHelper propertyEditorHelper;
 
+    private NamedEventManager namedEventManager;
+
     public ApplicationAssociate(ApplicationImpl appImpl) {
         app = appImpl;
 
@@ -516,6 +518,14 @@
     
     
 
+    public synchronized NamedEventManager getNamedEventManager() {
+        if (namedEventManager == null) {
+            namedEventManager = new NamedEventManager();
+        }
+        return namedEventManager;
+    }
+
+
     /**
      * Return a <code>Map</code> of navigation mappings loaded from
      * the configuration system.  The key for the returned <code>Map</code>
Index: jsf-ri/src/com/sun/faces/application/NamedEventManager.java
===================================================================
--- jsf-ri/src/com/sun/faces/application/NamedEventManager.java	(revision 0)
+++ jsf-ri/src/com/sun/faces/application/NamedEventManager.java	(revision 0)
@@ -0,0 +1,62 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.sun.faces.application;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AfterAddToParentEvent;
+import javax.faces.event.AfterAddToViewEvent;
+import javax.faces.event.BeforeRenderEvent;
+import javax.faces.event.SystemEvent;
+
+/**
+ * Note: New, relevant spec'd ComponentSystemEvents must be added to the constructor
+ */
+public class NamedEventManager {
+
+    private Map<String, Class<? extends SystemEvent>> namedEvents =
+            new ConcurrentHashMap<String, Class<? extends SystemEvent>>();
+    private Map<String, Set<Class<? extends SystemEvent>>> duplicateNames =
+             new ConcurrentHashMap<String, Set<Class<? extends SystemEvent>>>();
+
+    public NamedEventManager() {
+        namedEvents.put("javax.faces.event.beforeRender", BeforeRenderEvent.class);
+        namedEvents.put("javax.faces.event.afterAddToParent", AfterAddToParentEvent.class);
+        namedEvents.put("javax.faces.event.afterAddToView", AfterAddToViewEvent.class);
+        namedEvents.put("beforeRender", BeforeRenderEvent.class);
+        namedEvents.put("afterAddToParent", AfterAddToParentEvent.class);
+        namedEvents.put("afterAddToView", AfterAddToViewEvent.class);
+    }
+
+    public void addNamedEvent(String name, Class<? extends SystemEvent> event) {
+        namedEvents.put(name, event);
+    }
+
+    public Class<? extends SystemEvent> getNamedEvent(String name) {
+        String foo = namedEvents.toString();
+        Class<? extends SystemEvent> namedEvent = namedEvents.get(name);
+        return namedEvent;
+    }
+
+    public void addDuplicateName(String name, Class<? extends SystemEvent> event) {
+        Class<? extends SystemEvent> registeredEvent = namedEvents.remove(name);
+        Set<Class<? extends SystemEvent>> events = duplicateNames.get(name);
+        if (events == null) {
+            events = new HashSet<Class<? extends SystemEvent>>();
+            duplicateNames.put(name, events);
+        }
+        events.add(event);
+        if (registeredEvent != null) {
+            events.add(registeredEvent);
+        }
+    }
+
+    public boolean isDuplicateNamedEvent(String name) {
+        return (namedEvents.get(name) != null) || (duplicateNames.get(name) != null);
+    }
+}
Index: jsf-ri/src/com/sun/faces/application/annotation/AnnotationManager.java
===================================================================
--- jsf-ri/src/com/sun/faces/application/annotation/AnnotationManager.java	(revision 6134)
+++ jsf-ri/src/com/sun/faces/application/annotation/AnnotationManager.java	(working copy)
@@ -24,6 +24,7 @@
 
 import com.sun.faces.util.FacesLogger;
 import com.sun.faces.util.Util;
+import javax.faces.event.SystemEvent;
 
 /**
  * This class represents the central point for annotation handling within a
@@ -65,6 +66,10 @@
           LISTENER_FOR_SCANNER
     };
 
+    private static final Scanner[] EVENTS_SCANNERS = {
+        RESOURCE_DEPENDENCY_SCANNER
+    };
+
     /**
      * Enum of the different processing targets and their associated
      * {@link Scanner}s
@@ -73,7 +78,8 @@
         UIComponent(UICOMPONENT_SCANNERS),
         Validator(VALIDATOR_SCANNERS),
         Converter(CONVERTER_SCANNERS),
-        Renderer(RENDERER_SCANNERS);
+        Renderer(RENDERER_SCANNERS),
+        SystemEvent(EVENTS_SCANNERS);
 
 
         @SuppressWarnings({"NonSerializableFieldInSerializableClass"})
@@ -196,7 +202,11 @@
 
     }
 
+    public void applySystemEventAnnotations(FacesContext ctx, SystemEvent e) {
+        applyAnnotations(ctx, e.getClass(), ProcessingTarget.SystemEvent, e);
+    }
 
+
     // --------------------------------------------------------- Private Methods
 
 
@@ -214,7 +224,8 @@
               new ConverterConfigHandler(),
               new ValidatorConfigHandler(),
               new RenderKitConfigHandler(),
-              new ManagedBeanConfigHandler()
+              new ManagedBeanConfigHandler(),
+              new NamedEventConfigHandler()
         };
         Map<Class<? extends Annotation>,ConfigAnnotationHandler> handlerMap =
               new HashMap<Class<? extends Annotation>,ConfigAnnotationHandler>();
Index: jsf-ri/src/com/sun/faces/application/annotation/NamedEventConfigHandler.java
===================================================================
--- jsf-ri/src/com/sun/faces/application/annotation/NamedEventConfigHandler.java	(revision 0)
+++ jsf-ri/src/com/sun/faces/application/annotation/NamedEventConfigHandler.java	(revision 0)
@@ -0,0 +1,92 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.sun.faces.application.annotation;
+
+import com.sun.faces.application.ApplicationAssociate;
+import com.sun.faces.application.NamedEventManager;
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import javax.faces.context.FacesContext;
+import javax.faces.event.NamedEvent;
+import javax.faces.event.SystemEvent;
+
+/**
+ * This class handles the processing the NamedEvent annotation.  For each class
+ * with this annotation, the following logic is applied:
+ * <ol>
+ *      <li>Get the unqualified class name (e.g., UserLoginEvent)</li>
+ *      <li>Strip off the trailing "Event", if present (e.g., UserLogin)</li>
+ *      <li>Convert the first character to lower-case (e.g., userLogin)</li>
+ *      <li>Prepend the package name to the lower-cased name</li>
+ *      <li>If the <code>shortName</code> attribute is, register the event by that name as well.</li>
+ * </ol>
+ */
+public class NamedEventConfigHandler implements ConfigAnnotationHandler {
+
+    private Map<Class<?>, Annotation> namedEvents;
+    private static final Collection<Class<? extends Annotation>> HANDLES;
+
+
+    static {
+        Collection<Class<? extends Annotation>> handles =
+                new ArrayList<Class<? extends Annotation>>(2);
+        handles.add(NamedEvent.class);
+        HANDLES = Collections.unmodifiableCollection(handles);
+    }
+
+    public Collection<Class<? extends Annotation>> getHandledAnnotations() {
+        return HANDLES;
+    }
+
+    public void collect(Class<?> target, Annotation annotation) {
+        if (namedEvents == null) {
+            namedEvents = new HashMap<Class<?>, Annotation>();
+        }
+        namedEvents.put(target, annotation);
+    }
+
+    public void push(FacesContext ctx) {
+        if (namedEvents != null) {
+            ApplicationAssociate associate =
+                    ApplicationAssociate.getInstance(ctx.getExternalContext());
+            if (associate != null) {
+                NamedEventManager nem = associate.getNamedEventManager();
+                for (Map.Entry<Class<?>, Annotation> entry : namedEvents.entrySet()) {
+                    process(nem, entry.getKey(), entry.getValue());
+                }
+            }
+        }
+    }
+
+    // --------------------------------------------------------- Private Methods
+    /*
+     */
+    private void process(NamedEventManager nem,
+            Class<?> annotatedClass,
+            Annotation annotation) {
+        String name = annotatedClass.getSimpleName();
+        int index = name.lastIndexOf("Event");
+        if (index > -1) {
+            name = name.substring(0, index);
+        }
+
+        name = annotatedClass.getPackage().getName() + ("." + name.charAt(0)).toLowerCase() + name.substring(1);
+        nem.addNamedEvent(name, (Class<? extends SystemEvent>) annotatedClass);
+
+        String shortName = ((NamedEvent) annotation).shortName();
+
+        if (!"".equals(shortName)) {
+            if (nem.isDuplicateNamedEvent(shortName)) {
+                nem.addDuplicateName(shortName, (Class<? extends SystemEvent>) annotatedClass);
+            } else {
+                nem.addNamedEvent(shortName, (Class<? extends SystemEvent>) annotatedClass);
+            }
+        }
+    }
+}
\ No newline at end of file
Index: jsf-ri/src/com/sun/faces/config/AnnotationScanner.java
===================================================================
--- jsf-ri/src/com/sun/faces/config/AnnotationScanner.java	(revision 6134)
+++ jsf-ri/src/com/sun/faces/config/AnnotationScanner.java	(working copy)
@@ -73,6 +73,7 @@
  *  <li>javax.faces.render.FacesRenderer</li>
  *  <li>javax.faces.model.ManagedBean</li>
  *  <li>javax.faces.model.ManagedBeans</li>
+ *  <li>javax.faces.event.NamedEvent</li>
  * </ul>
  */
 public class AnnotationScanner {
@@ -94,6 +95,7 @@
         annotations.add("Ljavax/faces/render/FacesRenderer;");
         annotations.add("Ljavax/faces/model/ManagedBean;");
         annotations.add("Ljavax/faces/model/ManagedBeans;");
+        annotations.add("Ljavax/faces/event/NamedEvent;");
         FACES_ANNOTATIONS = Collections.unmodifiableSet(annotations);
     }
 
Index: jsf-ri/systest/src/com/sun/faces/systest/model/EventTagBean.java
===================================================================
--- jsf-ri/systest/src/com/sun/faces/systest/model/EventTagBean.java	(revision 0)
+++ jsf-ri/systest/src/com/sun/faces/systest/model/EventTagBean.java	(revision 0)
@@ -0,0 +1,20 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.sun.faces.systest.model;
+
+import javax.faces.component.UIOutput;
+import javax.faces.event.ComponentSystemEvent;
+
+/**
+ *
+ */
+public class EventTagBean {
+
+    public void beforeEncode(ComponentSystemEvent event) {
+        UIOutput output = (UIOutput)event.getComponent();
+        output.setValue("The '" + event.getClass().getName() + "' event fired!");
+    }
+}
Index: jsf-ri/systest/web/eventTag.xhtml
===================================================================
--- jsf-ri/systest/web/eventTag.xhtml	(revision 0)
+++ jsf-ri/systest/web/eventTag.xhtml	(revision 0)
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core">
+    <h:head>
+        <title>Test that f:event handles events correctly</title>
+    </h:head>
+
+    <h:body>
+    <h1>Test that f:event handles events correctly</h1>
+
+
+    <h:form id="form" prependId="false">
+        <h:outputText id="beforeRenderTest1" >
+            <f:event type="beforeRender" target="#{eventTagBean.beforeEncode}" />
+        </h:outputText>
+        <br />
+        <h:outputText id="beforeRenderTest2" >
+            <f:event type="javax.faces.event.beforeRender" target="#{eventTagBean.beforeEncode}" />
+        </h:outputText>
+        <br />
+        <h:outputText id="afterAddToParentTest1" >
+            <f:event type="afterAddToParent" target="#{eventTagBean.beforeEncode}" />
+        </h:outputText>
+        <br />
+        <h:outputText id="afterAddToParentTest2" >
+            <f:event type="javax.faces.event.afterAddToParent" target="#{eventTagBean.beforeEncode}" />
+        </h:outputText>
+    </h:form>
+  </h:body>
+</html>
Index: jsf-ri/systest/web/WEB-INF/faces-config.xml
===================================================================
--- jsf-ri/systest/web/WEB-INF/faces-config.xml	(revision 6134)
+++ jsf-ri/systest/web/WEB-INF/faces-config.xml	(working copy)
@@ -625,6 +625,12 @@
         <managed-bean-class>com.sun.faces.systest.model.CustomDatatableBean</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
+    
+    <managed-bean>
+        <managed-bean-name>eventTagBean</managed-bean-name>
+        <managed-bean-class>com.sun.faces.systest.model.EventTagBean</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+    </managed-bean>
 
   <navigation-rule>
     <from-view-id>*</from-view-id>
Index: jsf-ri/systest/web/WEB-INF/web.xml
===================================================================
--- jsf-ri/systest/web/WEB-INF/web.xml	(revision 6134)
+++ jsf-ri/systest/web/WEB-INF/web.xml	(working copy)
@@ -95,6 +95,7 @@
         </jsp-property-group>
     </jsp-config>
 
+
     <!-- Faces Servlet -->
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>
Index: jsf-ri/systest/web/eventTagInvalid.xhtml
===================================================================
--- jsf-ri/systest/web/eventTagInvalid.xhtml	(revision 0)
+++ jsf-ri/systest/web/eventTagInvalid.xhtml	(revision 0)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core">
+    <h:head>
+        <title>Test that f:event handles events correctly</title>
+    </h:head>
+
+    <h:body>
+    <h1>Test that f:event handles events correctly</h1>
+
+
+    <h:form id="form" prependId="false">
+        <h:outputText id="beforeRenderTest" >
+            <f:event type="invalidEvent" target="#{eventTagBean.beforeEncode}" />
+        </h:outputText>
+    </h:form>
+  </h:body>
+</html>
Index: jsf-ri/systest/build-tests.xml
===================================================================
--- jsf-ri/systest/build-tests.xml	(revision 6134)
+++ jsf-ri/systest/build-tests.xml	(working copy)
@@ -141,6 +141,7 @@
                 test.hello,
                 test.external,
                 test.el,
+                test.f.event,
                 test.resourcelocation,
                 test.managed,
                 test.message,
@@ -255,6 +256,17 @@
         </jsf.junit>
     </target>
 
+    <target name="test.f.event">
+        <jsf.junit context-path="${context.path}"
+                   classpath-refid="html.classpath"
+                   test-results-dir="${impl.test.results.dir}">
+            <tests>
+                <fileset dir="${basedir}/build/classes"
+                         includes="com/sun/faces/systest/tags/EventTestCase.class"/> 
+            </tests>
+        </jsf.junit>
+    </target>
+
     <target name="test.resourcelocation">
         <jsf.junit context-path="${context.path}"
                    classpath-refid="html.classpath"


SECTION: New Files
----------------------------
SEE ATTACHMENTS
