myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r673816 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/
Date Thu, 03 Jul 2008 21:21:29 GMT
Author: skitching
Date: Thu Jul  3 14:21:28 2008
New Revision: 673816

URL: http://svn.apache.org/viewvc?rev=673816&view=rev
Log:
Set svn:eol-style to native

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ApplyRequestValuesExecutor.java
  (contents, props changed)
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/InvokeApplicationExecutor.java
  (contents, props changed)
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseExecutor.java
  (contents, props changed)
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ProcessValidationsExecutor.java
  (contents, props changed)
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
  (contents, props changed)
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
  (contents, props changed)
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/UpdateModelValuesExecutor.java
  (contents, props changed)

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ApplyRequestValuesExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ApplyRequestValuesExecutor.java?rev=673816&r1=673815&r2=673816&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ApplyRequestValuesExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ApplyRequestValuesExecutor.java
Thu Jul  3 14:21:28 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.lifecycle;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-/**
- * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
- * @author Nikolay Petrov
- *
- * Apply request values phase (JSF Spec 2.2.2)
- */
-class ApplyRequestValuesExecutor implements PhaseExecutor {
-    public boolean execute(FacesContext facesContext) {
-        facesContext.getViewRoot().processDecodes(facesContext);
-        return false;
-    }
-
-    public PhaseId getPhase() {
-        return PhaseId.APPLY_REQUEST_VALUES;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.lifecycle;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+
+/**
+ * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
+ * @author Nikolay Petrov
+ *
+ * Apply request values phase (JSF Spec 2.2.2)
+ */
+class ApplyRequestValuesExecutor implements PhaseExecutor {
+    public boolean execute(FacesContext facesContext) {
+        facesContext.getViewRoot().processDecodes(facesContext);
+        return false;
+    }
+
+    public PhaseId getPhase() {
+        return PhaseId.APPLY_REQUEST_VALUES;
+    }
+}

Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ApplyRequestValuesExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/InvokeApplicationExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/InvokeApplicationExecutor.java?rev=673816&r1=673815&r2=673816&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/InvokeApplicationExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/InvokeApplicationExecutor.java
Thu Jul  3 14:21:28 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.lifecycle;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-/**
- * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
- * @author Nikolay Petrov
- *
- * Invoke application phase (JSF Spec 2.2.5)
- */
-class InvokeApplicationExecutor implements PhaseExecutor {
-    public boolean execute(FacesContext facesContext) {
-        facesContext.getViewRoot().processApplication(facesContext);
-        return false;
-    }
-
-    public PhaseId getPhase() {
-        return PhaseId.INVOKE_APPLICATION;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.lifecycle;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+
+/**
+ * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
+ * @author Nikolay Petrov
+ *
+ * Invoke application phase (JSF Spec 2.2.5)
+ */
+class InvokeApplicationExecutor implements PhaseExecutor {
+    public boolean execute(FacesContext facesContext) {
+        facesContext.getViewRoot().processApplication(facesContext);
+        return false;
+    }
+
+    public PhaseId getPhase() {
+        return PhaseId.INVOKE_APPLICATION;
+    }
+}

Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/InvokeApplicationExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseExecutor.java?rev=673816&r1=673815&r2=673816&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseExecutor.java
Thu Jul  3 14:21:28 2008
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.lifecycle;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-/**
- * Implements the PhaseExecutor for a lifecycle
- *
- * @author Nikolay Petrov
- *
- */
-interface PhaseExecutor {
-  
-  /**
-   * Executes a phase of the JavaServer(tm) Faces lifecycle, like UpdateModelValues.
-   * The <code>execute</code> method is called by the lifecylce implementation's
private
-   * <code>executePhase</code>.
-   * @param facesContext The <code>FacesContext</code> for the current request
we are processing 
-   * @return <code>true</code> if execution should be stopped
-   */
-    boolean execute(FacesContext facesContext);
-    
-  /**
-   * Returns the <code>PhaseId</code> for which the implemented executor is invoked

-   * @return
-   */
-  PhaseId getPhase();
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.lifecycle;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+
+/**
+ * Implements the PhaseExecutor for a lifecycle
+ *
+ * @author Nikolay Petrov
+ *
+ */
+interface PhaseExecutor {
+  
+  /**
+   * Executes a phase of the JavaServer(tm) Faces lifecycle, like UpdateModelValues.
+   * The <code>execute</code> method is called by the lifecylce implementation's
private
+   * <code>executePhase</code>.
+   * @param facesContext The <code>FacesContext</code> for the current request
we are processing 
+   * @return <code>true</code> if execution should be stopped
+   */
+    boolean execute(FacesContext facesContext);
+    
+  /**
+   * Returns the <code>PhaseId</code> for which the implemented executor is invoked

+   * @return
+   */
+  PhaseId getPhase();
 }
\ No newline at end of file

Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ProcessValidationsExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ProcessValidationsExecutor.java?rev=673816&r1=673815&r2=673816&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ProcessValidationsExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ProcessValidationsExecutor.java
Thu Jul  3 14:21:28 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.lifecycle;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-/**
- * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
- * @author Nikolay Petrov
- *
- * Process validations phase (JSF Spec 2.2.3)
- */
-class ProcessValidationsExecutor implements PhaseExecutor {
-    public boolean execute(FacesContext facesContext) {
-        facesContext.getViewRoot().processValidators(facesContext);
-        return false;
-    }
-
-    public PhaseId getPhase() {
-        return PhaseId.PROCESS_VALIDATIONS;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.lifecycle;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+
+/**
+ * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
+ * @author Nikolay Petrov
+ *
+ * Process validations phase (JSF Spec 2.2.3)
+ */
+class ProcessValidationsExecutor implements PhaseExecutor {
+    public boolean execute(FacesContext facesContext) {
+        facesContext.getViewRoot().processValidators(facesContext);
+        return false;
+    }
+
+    public PhaseId getPhase() {
+        return PhaseId.PROCESS_VALIDATIONS;
+    }
+}

Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/ProcessValidationsExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java?rev=673816&r1=673815&r2=673816&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
Thu Jul  3 14:21:28 2008
@@ -1,51 +1,51 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.lifecycle;
-
-import java.io.IOException;
-
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.application.ViewHandler;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-/**
- * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
- * @author Nikolay Petrov
- *
- * render response phase (JSF Spec 2.2.6)
- */
-class RenderResponseExecutor implements PhaseExecutor {
-    public boolean execute(FacesContext facesContext) {
-        Application application = facesContext.getApplication();
-        ViewHandler viewHandler = application.getViewHandler();
-
-        try {
-            viewHandler.renderView(facesContext, facesContext.getViewRoot());
-        } catch (IOException e) {
-            throw new FacesException(e.getMessage(), e);
-        }
-        return false;
-    }
-
-    public PhaseId getPhase() {
-        return PhaseId.RENDER_RESPONSE;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.lifecycle;
+
+import java.io.IOException;
+
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+
+/**
+ * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
+ * @author Nikolay Petrov
+ *
+ * render response phase (JSF Spec 2.2.6)
+ */
+class RenderResponseExecutor implements PhaseExecutor {
+    public boolean execute(FacesContext facesContext) {
+        Application application = facesContext.getApplication();
+        ViewHandler viewHandler = application.getViewHandler();
+
+        try {
+            viewHandler.renderView(facesContext, facesContext.getViewRoot());
+        } catch (IOException e) {
+            throw new FacesException(e.getMessage(), e);
+        }
+        return false;
+    }
+
+    public PhaseId getPhase() {
+        return PhaseId.RENDER_RESPONSE;
+    }
+}

Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RenderResponseExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java?rev=673816&r1=673815&r2=673816&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
Thu Jul  3 14:21:28 2008
@@ -1,153 +1,153 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.lifecycle;
-
-import java.io.IOException;
-
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-import javax.portlet.PortletRequest;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.portlet.MyFacesGenericPortlet;
-import org.apache.myfaces.portlet.PortletUtil;
-import org.apache.myfaces.shared_impl.util.RestoreStateUtils;
-import org.apache.myfaces.util.DebugUtils;
-import org.apache.myfaces.renderkit.html.HtmlResponseStateManager;
-
-/**
- * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
- * @author Nikolay Petrov
- *
- * Restore view phase (JSF Spec 2.2.1)
- */
-class RestoreViewExecutor implements PhaseExecutor {
-
-    private static final Log log = LogFactory.getLog(LifecycleImpl.class);
-
-    public boolean execute(FacesContext facesContext) {
-        if(facesContext.getViewRoot() != null) {
-            facesContext.getViewRoot().setLocale(facesContext.getExternalContext().getRequestLocale());
-            RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(facesContext,
facesContext.getViewRoot());
-            return false;
-        }
-
-        // Derive view identifier
-        String viewId = deriveViewId(facesContext);
-
-        if (viewId == null) {
-            ExternalContext externalContext = facesContext.getExternalContext();
-
-            if(externalContext.getRequestServletPath() == null) {
-                return true;
-            }
-            
-            if (!externalContext.getRequestServletPath().endsWith("/")) {
-                try {
-                    externalContext.redirect(externalContext.getRequestServletPath() + "/");
-                    facesContext.responseComplete();
-                    return true;
-                } catch (IOException e) {
-                    throw new FacesException("redirect failed", e);
-                }
-            }
-        }
-
-        Application application = facesContext.getApplication();
-        ViewHandler viewHandler = application.getViewHandler();
-
-        // boolean viewCreated = false;
-        UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewId);
-        if (viewRoot == null) {
-            viewRoot = viewHandler.createView(facesContext, viewId);
-            viewRoot.setViewId(viewId);
-            facesContext.renderResponse();
-            // viewCreated = true;
-        }
-
-        facesContext.setViewRoot(viewRoot);
-
-    if (!isPostback(facesContext)) {
-            // no POST or query parameters --> set render response flag
-            facesContext.renderResponse();
-        }
-
-        RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(facesContext, viewRoot);
-        return false;
-    }
-  
-    
-  /**
-   * Return <code>true</code> if the current request is a post back and
-   * <code>false</code> otherwise.
-   * 
-   * @param  facesContext  the current faces context
-   * @return <code>true</code> if the current request is a post back and
-   *         <code>false</code> otherwise
-   */
-  private boolean isPostback(FacesContext facesContext) {
-      return facesContext.getExternalContext().getRequestParameterMap().containsKey(HtmlResponseStateManager.STANDARD_STATE_SAVING_PARAM);
-  } 
-
-    public PhaseId getPhase() {
-        return PhaseId.RESTORE_VIEW;
-    }
-
-    private static String deriveViewId(FacesContext facesContext) {
-        ExternalContext externalContext = facesContext.getExternalContext();
-
-        if (PortletUtil.isPortletRequest(facesContext)) {
-            PortletRequest request = (PortletRequest) externalContext.getRequest();
-            return request.getParameter(MyFacesGenericPortlet.VIEW_ID);
-        }
-
-        String viewId = externalContext.getRequestPathInfo(); // getPathInfo
-        if (viewId == null) {
-            // No extra path info found, so it is probably extension mapping
-            viewId = externalContext.getRequestServletPath(); // getServletPath
-            DebugUtils.assertError(viewId != null, log,
-                    "RequestServletPath is null, cannot determine viewId of current page.");
-            if (viewId == null)
-                return null;
-
-            // TODO: JSF Spec 2.2.1 - what do they mean by "if the default
-            // ViewHandler implementation is used..." ?
-            String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME);
-            String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX;
-            DebugUtils.assertError(suffix.charAt(0) == '.', log, "Default suffix must start
with a dot!");
-
-            int slashPos = viewId.lastIndexOf('/');
-            int extensionPos = viewId.lastIndexOf('.');
-            if (extensionPos == -1 || extensionPos <= slashPos) {
-                log.error("Assumed extension mapping, but there is no extension in " + viewId);
-                viewId = null;
-            } else {
-                viewId = viewId.substring(0, extensionPos) + suffix;
-            }
-        }
-
-        return viewId;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.lifecycle;
+
+import java.io.IOException;
+
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+import javax.portlet.PortletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.portlet.MyFacesGenericPortlet;
+import org.apache.myfaces.portlet.PortletUtil;
+import org.apache.myfaces.shared_impl.util.RestoreStateUtils;
+import org.apache.myfaces.util.DebugUtils;
+import org.apache.myfaces.renderkit.html.HtmlResponseStateManager;
+
+/**
+ * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
+ * @author Nikolay Petrov
+ *
+ * Restore view phase (JSF Spec 2.2.1)
+ */
+class RestoreViewExecutor implements PhaseExecutor {
+
+    private static final Log log = LogFactory.getLog(LifecycleImpl.class);
+
+    public boolean execute(FacesContext facesContext) {
+        if(facesContext.getViewRoot() != null) {
+            facesContext.getViewRoot().setLocale(facesContext.getExternalContext().getRequestLocale());
+            RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(facesContext,
facesContext.getViewRoot());
+            return false;
+        }
+
+        // Derive view identifier
+        String viewId = deriveViewId(facesContext);
+
+        if (viewId == null) {
+            ExternalContext externalContext = facesContext.getExternalContext();
+
+            if(externalContext.getRequestServletPath() == null) {
+                return true;
+            }
+            
+            if (!externalContext.getRequestServletPath().endsWith("/")) {
+                try {
+                    externalContext.redirect(externalContext.getRequestServletPath() + "/");
+                    facesContext.responseComplete();
+                    return true;
+                } catch (IOException e) {
+                    throw new FacesException("redirect failed", e);
+                }
+            }
+        }
+
+        Application application = facesContext.getApplication();
+        ViewHandler viewHandler = application.getViewHandler();
+
+        // boolean viewCreated = false;
+        UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewId);
+        if (viewRoot == null) {
+            viewRoot = viewHandler.createView(facesContext, viewId);
+            viewRoot.setViewId(viewId);
+            facesContext.renderResponse();
+            // viewCreated = true;
+        }
+
+        facesContext.setViewRoot(viewRoot);
+
+    if (!isPostback(facesContext)) {
+            // no POST or query parameters --> set render response flag
+            facesContext.renderResponse();
+        }
+
+        RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(facesContext, viewRoot);
+        return false;
+    }
+  
+    
+  /**
+   * Return <code>true</code> if the current request is a post back and
+   * <code>false</code> otherwise.
+   * 
+   * @param  facesContext  the current faces context
+   * @return <code>true</code> if the current request is a post back and
+   *         <code>false</code> otherwise
+   */
+  private boolean isPostback(FacesContext facesContext) {
+      return facesContext.getExternalContext().getRequestParameterMap().containsKey(HtmlResponseStateManager.STANDARD_STATE_SAVING_PARAM);
+  } 
+
+    public PhaseId getPhase() {
+        return PhaseId.RESTORE_VIEW;
+    }
+
+    private static String deriveViewId(FacesContext facesContext) {
+        ExternalContext externalContext = facesContext.getExternalContext();
+
+        if (PortletUtil.isPortletRequest(facesContext)) {
+            PortletRequest request = (PortletRequest) externalContext.getRequest();
+            return request.getParameter(MyFacesGenericPortlet.VIEW_ID);
+        }
+
+        String viewId = externalContext.getRequestPathInfo(); // getPathInfo
+        if (viewId == null) {
+            // No extra path info found, so it is probably extension mapping
+            viewId = externalContext.getRequestServletPath(); // getServletPath
+            DebugUtils.assertError(viewId != null, log,
+                    "RequestServletPath is null, cannot determine viewId of current page.");
+            if (viewId == null)
+                return null;
+
+            // TODO: JSF Spec 2.2.1 - what do they mean by "if the default
+            // ViewHandler implementation is used..." ?
+            String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME);
+            String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX;
+            DebugUtils.assertError(suffix.charAt(0) == '.', log, "Default suffix must start
with a dot!");
+
+            int slashPos = viewId.lastIndexOf('/');
+            int extensionPos = viewId.lastIndexOf('.');
+            if (extensionPos == -1 || extensionPos <= slashPos) {
+                log.error("Assumed extension mapping, but there is no extension in " + viewId);
+                viewId = null;
+            } else {
+                viewId = viewId.substring(0, extensionPos) + suffix;
+            }
+        }
+
+        return viewId;
+    }
+}

Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/UpdateModelValuesExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/UpdateModelValuesExecutor.java?rev=673816&r1=673815&r2=673816&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/UpdateModelValuesExecutor.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/UpdateModelValuesExecutor.java
Thu Jul  3 14:21:28 2008
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.lifecycle;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-
-/**
- * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
- * @author Nikolay Petrov
- *
- * Update model values phase (JSF Spec 2.2.4)
- */
-class UpdateModelValuesExecutor implements PhaseExecutor {
-    public boolean execute(FacesContext facesContext) {
-        facesContext.getViewRoot().processUpdates(facesContext);
-        return false;
-    }
-
-    public PhaseId getPhase() {
-        return PhaseId.UPDATE_MODEL_VALUES;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.lifecycle;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+
+
+/**
+ * Implements the lifecycle as described in Spec. 1.0 PFD Chapter 2
+ * @author Nikolay Petrov
+ *
+ * Update model values phase (JSF Spec 2.2.4)
+ */
+class UpdateModelValuesExecutor implements PhaseExecutor {
+    public boolean execute(FacesContext facesContext) {
+        facesContext.getViewRoot().processUpdates(facesContext);
+        return false;
+    }
+
+    public PhaseId getPhase() {
+        return PhaseId.UPDATE_MODEL_VALUES;
+    }
+}

Propchange: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/UpdateModelValuesExecutor.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message