You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mc...@apache.org on 2009/05/13 17:07:17 UTC

svn commit: r774391 - in /myfaces/core/branches/2_0_0: api/src/main/java/javax/faces/application/ api/src/main/java/javax/faces/view/ impl/src/main/java/org/apache/myfaces/application/ impl/src/main/java/org/apache/myfaces/view/ impl/src/main/java/org/...

Author: mconcini
Date: Wed May 13 15:07:17 2009
New Revision: 774391

URL: http://svn.apache.org/viewvc?rev=774391&view=rev
Log:
MYFACES-2219 - ViewHandler todo's and related changes. 

Modified:
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/ViewHandler.java
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/AttachedObjectTarget.java
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageBase.java
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
    myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguage.java

Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/ViewHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/ViewHandler.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/ViewHandler.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/application/ViewHandler.java Wed May 13 15:07:17 2009
@@ -160,21 +160,17 @@
      */
     public String deriveViewId(FacesContext context, String input)
     {
-        // TODO: IMPLEMENT HERE? I would have said IMPL
-        return null;
+        //The default implementation of this method simply returns rawViewId unchanged.
+        return input;
     }
 
     /**
-     * TODO: IMPLEMENT IMPL - new algorithm see section 7.5.2 of the specification
-     * 
-     * Return a URL that a remote system can invoke in order to access the specified view.
-     * <p>
-     * Note that the URL a user enters and the viewId which is invoked can be different. The simplest difference 
-     * is a change in suffix (eg url "foo.jsf" references view "foo.jsp").
+     * Returns a URL, suitable for encoding and rendering, that (if activated) will cause the JSF request processing lifecycle for the specified viewId to be executed
      */
     public abstract String getActionURL(FacesContext context, String viewId);
 
     /**
+     * Return a JSF action URL derived from the viewId argument that is suitable to be used as the target of a link in a JSF response. Compiliant implementations must implement this method as specified in section JSF.7.5.2. The default implementation simply calls through to getActionURL(javax.faces.context.FacesContext, java.lang.String), passing the arguments context and viewId.
      * 
      * @param context
      * @param viewId
@@ -187,11 +183,16 @@
     public String getBookmarkableURL(FacesContext context, String viewId, Map<String, List<String>> parameters,
                                      boolean includeViewParams)
     {
-        // TODO: IMPLEMENT IMPL
         return getActionURL(context, viewId);
     }
 
     /**
+     * Return the ViewDeclarationLanguage instance used for this ViewHandler  instance.
+     * <P>
+     * The default implementation must use ViewDeclarationLanguageFactory.getViewDeclarationLanguage(java.lang.String) to obtain the appropriate ViewDeclarationLanguage implementation for the argument viewId. Any exceptions thrown as a result of invoking that method must not be swallowed.
+     * <P>
+     * The default implementation of this method returns null.
+     * 
      * @param context
      * @param viewId
      * @return
@@ -203,6 +204,8 @@
     }
 
     /**
+     * Return a JSF action URL derived from the viewId argument that is suitable to be used by the NavigationHandler to issue a redirect request to the URL using a NonFaces request. Compiliant implementations must implement this method as specified in section JSF.7.5.2. The default implementation simply calls through to getActionURL(javax.faces.context.FacesContext, java.lang.String), passing the arguments context and viewId.
+     * 
      * @param context
      * @param viewId
      * @param parameters
@@ -212,24 +215,20 @@
     public String getRedirectURL(FacesContext context, String viewId, Map<String, List<String>> parameters,
                                  boolean includeViewParams)
     {
-        // TODO: IMPLEMENT IMPL
         return getActionURL(context, viewId);
     }
 
     /**
-     * TODO: IMPLEMENT IMPL - new algorithm see section 7.5.2 of the specification
-     * 
-     * Return a URL that a remote system can invoke in order to access the specified resource.
-     * <p>
-     * When path starts with a slash, it is relative to the webapp root. Otherwise it is relative to the value returned
-     * by getActionURL.
+     * Returns a URL, suitable for encoding and rendering, that (if activated) will retrieve the specified web application resource.
      */
     public abstract String getResourceURL(FacesContext context, String path);
 
     /**
-     * TODO: IMPLEMENT IMPL - algorithm change
-     * 
-     * Method must be called by the JSF impl at the beginning of Phase <i>Restore View</i> of the JSF lifecycle.
+     * Initialize the view for the request processing lifecycle.
+     * <P>
+     * This method must be called at the beginning of the Restore View Phase of the Request Processing Lifecycle. It is responsible for performing any per-request initialization necessary to the operation of the lifycecle.
+     * <P>
+     * The default implementation must perform the following actions. If ExternalContext.getRequestCharacterEncoding() returns null, call calculateCharacterEncoding(javax.faces.context.FacesContext) and pass the result, if non-null, into the ExternalContext.setRequestCharacterEncoding(java.lang.String) method. If ExternalContext.getRequestCharacterEncoding() returns non-null take no action.
      * 
      * @since JSF 1.2
      */
@@ -250,94 +249,23 @@
     }
 
     /**
-     * TODO: IMPLEMENT IMPL - new algorithm see the specification
-     * 
-     * Combine the output of all the components in the viewToRender with data from the original view template (if any)
-     * and write the result to context.externalContext.response.
-     * <p>
-     * Component output is generated by invoking the encodeBegin, encodeChildren (optional) and encodeEnd methods on
-     * relevant components in the specified view. How this is interleaved with the non-component content of the view
-     * template (if any) is left to the ViewHandler implementation.
-     * <p>
-     * The actual type of the Response object depends upon the concrete implementation of this class. It will almost
-     * certainly be an OutputStream of some sort, but may be specific to the particular request/response system in use.
-     * <p>
-     * If the view cannot be rendered (eg due to an error in a component) then a FacesException is thrown.
-     * <p>
-     * Note that if a "postback" has occurred but no navigation to a different view, then the viewToRender will be fully
-     * populated with components already. However on direct access to a new view, or when navigation has occurred, the
-     * viewToRender will just contain an empty UIViewRoot object that must be populated with components from the
-     * "view template".
+     *  Perform whatever actions are required to render the response view to the response object associated with the current FacesContext.
+     *  <P>
+     *  Otherwise, the default implementation must obtain a reference to the ViewDeclarationLanguage for the viewId of the argument viewToRender and call its ViewDeclarationLanguage.renderView(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot) method, returning the result and not swallowing any exceptions thrown by that method.
      */
     public abstract void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesException;
 
     /**
-     * TODO: IMPLEMENT IMPL - new algorithm see the specification
-     * 
-     * Handle a "postback" request by recreating the component tree that was most recently presented to the user for the
-     * specified view.
-     * <p>
-     * When the user performs a "postback" of a view that has previously been created, ie is updating the state of an
-     * existing view tree, then the view handler must recreate a view tree identical to the one used previously to
-     * render that view to the user, so that the data received from the user can be compared to the old state and the
-     * correct "changes" detected (well, actually only those components that respond to input are actually needed before
-     * the render phase).
-     * <p>
-     * The components in this tree will then be given the opportunity to examine new input data provided by the user,
-     * and react in the appropriate manner for that component, as specified for the JSF lifecycle.
-     * <p>
-     * Much of the work required by this method <i>must</i> be delegated to an instance of StateManager.
-     * <p>
-     * If there is no record of the current user having been sent the specified view (ie no saved state information
-     * available), then NULL should be returned.
-     * <p>
-     * Note that input data provided by the user may also be used to determine exactly how to restore this view. In the
-     * case of "client side state", information about the components to be restored will be available here. Even for
-     * "server side state", user input may include an indicator that is used to select among a number of different saved
-     * states available for this viewId and this user.
-     * <p>
-     * Note that data received from users is inherently untrustworthy; care should be taken to validate this information
-     * appropriately.
-     * <p>
-     * See writeState for more details.
+     * Perform whatever actions are required to restore the view associated with the specified FacesContext and viewId. It may delegate to the restoreView of the associated StateManager to do the actual work of restoring the view. If there is no available state for the specified viewId, return null.
+     * <P>
+     * Otherwise, the default implementation must obtain a reference to the ViewDeclarationLanguage for this viewId and call its ViewDeclarationLanguage.restoreView(javax.faces.context.FacesContext, java.lang.String) method, returning the result and not swallowing any exceptions thrown by that method.
      */
     public abstract UIViewRoot restoreView(FacesContext context, String viewId);
 
     /**
-     * @param context
-     * @param topLevelComponent
-     * @param handlers
-     */
-    public void retargetAttachedObjects(FacesContext context, UIComponent topLevelComponent,
-                                        List<AttachedObjectHandler> handlers)
-    {
-        // TODO: IMPLEMENT IMPL
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * @param context
-     * @param topLevelComponent
-     */
-    public void retargetMethodExpressions(FacesContext context, UIComponent topLevelComponent)
-    {
-        // TODO: IMPLEMENT IMPL
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * TODO: IMPLEMENT IMPL - algorithm change
-     * 
-     * Write sufficient information to context.externalContext.response in order to be able to restore this view if the
-     * user performs a "postback" using that rendered response.
-     * <p>
-     * For "client side state saving", sufficient information about the view state should be written to allow a
-     * "restore view" operation to succeed later. This does not necessarily mean storing <i>all</i> data about the
-     * current view; only data that cannot be recreated from the "template" for this view needs to be saved.
-     * <p>
-     * For "server side state saving", this method may write out nothing. Alternately it may write out a
-     * "state identifier" to identify which of multiple saved user states for a particular view should be selected (or
-     * just verify that the saved state does indeed correspond to the expected one).
+     * Take any appropriate action to either immediately write out the current state information (by calling StateManager.writeState(javax.faces.context.FacesContext, java.lang.Object), or noting where state information should later be written.
+     * <P>
+     * This method must do nothing if the current request is an Ajax request. When responding to Ajax requests, the state is obtained by calling StateManager.getViewState(javax.faces.context.FacesContext) and then written into the Ajax response during final encoding (UIViewRoot.encodeEnd(javax.faces.context.FacesContext). 
      */
     public abstract void writeState(FacesContext context) throws IOException;
 

Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/AttachedObjectTarget.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/AttachedObjectTarget.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/AttachedObjectTarget.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/AttachedObjectTarget.java Wed May 13 15:07:17 2009
@@ -38,5 +38,5 @@
 
     public String getName();
 
-    public List<UIComponent> getTargets();
+    public List<UIComponent> getTargets(UIComponent topLevelComponent);
 }

Modified: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java (original)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java Wed May 13 15:07:17 2009
@@ -20,8 +20,10 @@
 
 import java.beans.BeanInfo;
 import java.io.IOException;
+import java.util.List;
 
 import javax.faces.application.Resource;
+import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 
@@ -40,10 +42,23 @@
     public abstract BeanInfo getComponentMetadata(FacesContext context, Resource componentResource);
 
     public abstract Resource getScriptComponentResource(FacesContext context, Resource componentResource);
+    
+    public abstract StateManagementStrategy getStateManagementStrategy(FacesContext context, String viewId); 
 
     public abstract ViewMetadata getViewMetadata(FacesContext context, String viewId);
 
     public abstract void renderView(FacesContext context, UIViewRoot view) throws IOException;
 
     public abstract UIViewRoot restoreView(FacesContext context, String viewId);
+    
+    public void retargetAttachedObjects(FacesContext context, UIComponent topLevelComponent, List<AttachedObjectHandler> handlers)
+    {
+        //TODO: implement impl
+    }
+
+    public void retargetMethodExpressions(FacesContext context, UIComponent topLevelComponent)
+    {
+        //TODO: implement impl
+    }
+              
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java Wed May 13 15:07:17 2009
@@ -208,7 +208,7 @@
         }
         // set default implementation in constructor
         // pragmatic approach, no syncronizing will be needed in get methods
-        _viewHandler = new JspViewHandlerImpl();
+        _viewHandler = new JspViewHandlerImpl(); //TODO: replace with new ViewHandlerImpl class when VDL methods are fully implemented
         _navigationHandler = new NavigationHandlerImpl();
         _actionListener = new ActionListenerImpl();
         _defaultRenderKitId = "HTML_BASIC";

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java Wed May 13 15:07:17 2009
@@ -87,8 +87,16 @@
                     }
                 }
                 if (!founded)
-                {
-                    builder.append(viewId);
+                {   
+                    if(viewId.lastIndexOf(".") != -1 )
+                    {
+                        builder.append(viewId.substring(0,viewId.lastIndexOf(".")));
+                    }
+                    else
+                    {
+                        builder.append(viewId);
+                    }
+                    builder.append(contextSuffixes[0]);
                 }
             }
             else

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageBase.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageBase.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageBase.java Wed May 13 15:07:17 2009
@@ -18,13 +18,40 @@
  */
 package org.apache.myfaces.view;
 
+import java.beans.BeanDescriptor;
+import java.beans.BeanInfo;
+import java.beans.PropertyDescriptor;
+import java.util.List;
+
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
 import javax.faces.application.Application;
 import javax.faces.application.ViewHandler;
+import javax.faces.component.ActionSource2;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.MethodExpressionActionListener;
+import javax.faces.event.MethodExpressionValueChangeListener;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.validator.MethodExpressionValidator;
+import javax.faces.view.ActionSource2AttachedObjectHandler;
+import javax.faces.view.ActionSource2AttachedObjectTarget;
+import javax.faces.view.AttachedObjectHandler;
+import javax.faces.view.AttachedObjectTarget;
+import javax.faces.view.EditableValueHolderAttachedObjectHandler;
+import javax.faces.view.EditableValueHolderAttachedObjectTarget;
+import javax.faces.view.ValueHolderAttachedObjectHandler;
+import javax.faces.view.ValueHolderAttachedObjectTarget;
 import javax.faces.view.ViewDeclarationLanguage;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.application.InvalidViewIdException;
+import org.apache.myfaces.application.ViewHandlerImpl;
 
 /**
  * @author Simon Lessard (latest modification by $Author: slessard $)
@@ -34,6 +61,8 @@
  */
 public abstract class ViewDeclarationLanguageBase extends ViewDeclarationLanguage
 {
+    
+    private static final Log log = LogFactory.getLog(ViewDeclarationLanguageBase.class);
     /**
      * Process the specification required algorithm that is generic to all PDL.
      * 
@@ -96,4 +125,185 @@
     protected abstract String calculateViewId(FacesContext context, String viewId);
     
     protected abstract void sendSourceNotFound(FacesContext context, String message);
+    
+    @Override
+    public void retargetMethodExpressions(FacesContext context, UIComponent topLevelComponent)
+    {
+        checkNull(context, "context");
+        checkNull(topLevelComponent, "topLevelComponent");
+        
+        BeanInfo beanInfo = (BeanInfo)topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
+        if(beanInfo == null)
+        {
+            return;  // should we log an error here?  spec doesn't say one way or the other so leaving it alone for now. 
+        }
+        
+        PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();
+        for(PropertyDescriptor curDescriptor : descriptors)
+        {
+            ExpressionFactory expressionFactory = null;
+            ValueExpression valueExpression = null;
+            MethodExpression attributeMethodExpression = null;
+            Class expectedReturn = null;
+            Class expectedParams[] = null;
+            
+            if(curDescriptor.getValue("type") != null || curDescriptor.getValue("method-signature") == null)
+            {
+                continue;   
+            }
+            
+            String targets = null;
+            valueExpression = (ValueExpression)curDescriptor.getValue("targets");
+            if(valueExpression != null)
+            {
+                targets = (String)valueExpression.getValue(context.getELContext());
+            }
+
+            if(targets == null)
+            {
+                targets = curDescriptor.getName();
+            }
+            
+            if(targets == null)
+            {
+                continue;   //not explicitly part of the algorithm, but could lead to an NPE if we don't check this
+            }
+            
+            String[] targetArray = targets.split(" ");
+            for (String curTarget : targetArray)
+            {
+                UIComponent target = topLevelComponent.findComponent(curTarget);
+                if(target == null)
+                {
+                    log.error("target not found");
+                    continue;
+                }
+                
+                String name = curDescriptor.getName();
+                
+                ValueExpression attributeValueExpression = (ValueExpression)topLevelComponent.getAttributes().get(name);
+                
+                if(attributeValueExpression == null)
+                {
+                    log.error("attributeValueExpression not found");
+                    continue;
+                }
+
+                if(expressionFactory == null)
+                {   //initialize expression factory if hasn't been used yet
+                    expressionFactory = context.getApplication().getExpressionFactory();
+                }
+                
+                boolean isAction = name.equals("action"),
+                        isActionListener = name.equals("actionListener"),
+                        isValidator = name.equals("validator"),
+                        isValueChangeListener = name.equals("valueChangeListener");
+                
+                String expressionString = attributeValueExpression.getExpressionString();
+                    
+                if(isAction)
+                    expectedReturn = Object.class;
+                else
+                    expectedReturn = Void.class;
+                
+                if(isAction)
+                {
+                    expectedParams =  new Class[]{};
+                    attributeMethodExpression = expressionFactory.createMethodExpression(context.getELContext(), expressionString, expectedReturn, expectedParams);
+                    ((ActionSource2) target).setActionExpression(attributeMethodExpression);
+                }
+                else if(isActionListener)
+                {
+                    expectedParams = new Class[]{ActionEvent.class};
+                    attributeMethodExpression = expressionFactory.createMethodExpression(context.getELContext(), expressionString, expectedReturn, expectedParams);
+                    ((ActionSource2) target).addActionListener(new MethodExpressionActionListener(attributeMethodExpression));
+                }
+                else if(isValidator)
+                {
+                    expectedParams = new Class[]{FacesContext.class,UIComponent.class,Object.class};
+                    attributeMethodExpression = expressionFactory.createMethodExpression(context.getELContext(), expressionString, expectedReturn, expectedParams);
+                    ((EditableValueHolder) target).addValidator(new MethodExpressionValidator(attributeMethodExpression));
+                }
+                else if(isValueChangeListener)
+                {
+                    expectedParams = new Class[]{ValueChangeEvent.class};
+                    attributeMethodExpression = expressionFactory.createMethodExpression(context.getELContext(), expressionString, expectedReturn, expectedParams);
+                    ((EditableValueHolder) target).addValueChangeListener(new MethodExpressionValueChangeListener(attributeMethodExpression));
+                }
+                else
+                {
+                    //TODO: implement here - derive attribute name from method-signature
+                    //If name is not equal to any of the previously listed strings, call getExpressionString() on the attributeValueExpression and use that string to create a MethodExpression 
+                    //where the signature is created based on the value of the "method-signature" attribute of the <composite:attribute /> tag.
+                    
+                    //Otherwise, assume that the MethodExpression  should be placed in the components attribute set. The runtme must create the MethodExpression instance based on the value of the "method-signature" attribute.
+                }
+                
+                
+            }
+        }
+    }
+    
+    @Override
+    public void retargetAttachedObjects(FacesContext context,
+            UIComponent topLevelComponent, List<AttachedObjectHandler> handlers)
+    {
+        checkNull(context, "context");
+        checkNull(topLevelComponent, "topLevelComponent");
+        checkNull(handlers, "handlers");
+        
+        BeanInfo beanInfo = (BeanInfo)topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
+        
+        if(beanInfo == null)
+        {
+            log.error("BeanInfo not found");
+            return;
+        }
+        
+        BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor();
+        List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)beanDescriptor.getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
+
+        for (AttachedObjectHandler curHandler : handlers)
+        {
+            String forAttributeValue = curHandler.getFor();
+
+            for(AttachedObjectTarget curTarget : targetList)
+            {
+                List<UIComponent> targetUIComponents = curTarget.getTargets(topLevelComponent);
+                String curTargetName = curTarget.getName();
+
+                if( (curHandler instanceof ActionSource2AttachedObjectHandler) && curHandler instanceof ActionSource2AttachedObjectTarget)
+                {
+                    applyAttachedObjects(context,targetUIComponents, curHandler);
+                    break;
+                }
+                if( (curHandler instanceof EditableValueHolderAttachedObjectHandler) && curHandler instanceof EditableValueHolderAttachedObjectTarget)
+                {
+                    applyAttachedObjects(context,targetUIComponents, curHandler);
+                    break;
+                }
+                if( (curHandler instanceof ValueHolderAttachedObjectHandler) && curHandler instanceof ValueHolderAttachedObjectTarget)
+                {
+                    applyAttachedObjects(context,targetUIComponents, curHandler);
+                    break;
+                }
+            }
+        }
+    }
+    
+    private void applyAttachedObjects(FacesContext context, List<UIComponent> targetUIComponents, AttachedObjectHandler curHandler)
+    {
+        for (UIComponent target : targetUIComponents)
+        {
+            curHandler.applyAttachedObject(context, target);
+        }
+    }
+    
+    private void checkNull(final Object o, final String param)
+    {
+        if (o == null)
+        {
+            throw new NullPointerException(param + " can not be null.");
+        }
+    }
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java Wed May 13 15:07:17 2009
@@ -25,6 +25,7 @@
 import javax.faces.application.Resource;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
+import javax.faces.view.StateManagementStrategy;
 import javax.faces.view.ViewMetadata;
 import javax.servlet.http.HttpServletResponse;
 
@@ -164,4 +165,12 @@
             throw new FacesException(ioe);
         }
     }
+
+    @Override
+    public StateManagementStrategy getStateManagementStrategy(
+            FacesContext context, String viewId)
+    {
+        // TODO implement here
+        return null;
+    }
 }

Modified: myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguage.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguage.java?rev=774391&r1=774390&r2=774391&view=diff
==============================================================================
--- myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguage.java (original)
+++ myfaces/core/branches/2_0_0/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguage.java Wed May 13 15:07:17 2009
@@ -25,6 +25,7 @@
 import javax.faces.application.Resource;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
+import javax.faces.view.StateManagementStrategy;
 import javax.faces.view.ViewMetadata;
 import javax.servlet.http.HttpServletResponse;
 
@@ -147,4 +148,12 @@
             throw new FacesException(ioe);
         }
     }
+
+    @Override
+    public StateManagementStrategy getStateManagementStrategy(
+            FacesContext context, String viewId)
+    {
+        // TODO implement here
+        return null;
+    }
 }