You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2007/10/29 21:10:37 UTC

svn commit: r589835 - in /myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application: DefaultViewHandlerSupport.java ViewHandlerSupport.java jsp/JspViewHandlerImpl.java

Author: skitching
Date: Mon Oct 29 13:10:36 2007
New Revision: 589835

URL: http://svn.apache.org/viewvc?rev=589835&view=rev
Log:
Documentation

Modified:
    myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java
    myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/ViewHandlerSupport.java
    myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java

Modified: myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java?rev=589835&r1=589834&r2=589835&view=diff
==============================================================================
--- myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java (original)
+++ myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java Mon Oct 29 13:10:36 2007
@@ -30,6 +30,9 @@
 import java.util.Map;
 
 /**
+ * A ViewHandlerSupport implementation for use with standard Java Servlet engines,
+ * ie an engine that supports javax.servlet, and uses a standard web.xml file.
+ * 
  * @author Mathias Broekelmann (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
@@ -95,6 +98,10 @@
         return calculatedActionURL;
     }
 
+    /**
+     * Read the web.xml file that is in the classpath and parse its internals to
+     * figure out how the FacesServlet is mapped for the current webapp.
+     */
     protected ServletMapping calculateServletMapping(FacesContext context)
     {
         ExternalContext externalContext = context.getExternalContext();
@@ -175,6 +182,12 @@
         return defaultSuffix;
     }
 
+    /**
+     * Return the viewId with any non-standard suffix stripped off and replaced with
+     * the default suffix configured for the specified context.
+     * <p>
+     * For example, an input parameter of "/foo.jsf" may return "/foo.jsp".
+     */
     protected String applyDefaultSuffix(FacesContext context, String viewId)
     {
         String defaultSuffix = getContextSuffix(context);

Modified: myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/ViewHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/ViewHandlerSupport.java?rev=589835&r1=589834&r2=589835&view=diff
==============================================================================
--- myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/ViewHandlerSupport.java (original)
+++ myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/ViewHandlerSupport.java Mon Oct 29 13:10:36 2007
@@ -21,6 +21,12 @@
 import javax.faces.context.FacesContext;
 
 /**
+ * A utility class to isolate a ViewHandler implementation from the underlying 
+ * request/response framework.
+ * <p>
+ * For example, an implementation of this interface might support javax.servlet,
+ * javax.portlet, or some other mechanism.
+ *    
  * @author Mathias Broekelmann (latest modification by $Author$)
  * @version $Revision$ $Date$
  */
@@ -28,5 +34,12 @@
 {
     String calculateViewId(FacesContext context, String viewId);
 
+    /**
+     * Return a string containing a webapp-relative URL that the user can invoke
+     * to render the specified view.
+     * <p>
+     * URLs and ViewIds are not quite the same; for example a url of "/foo.jsf"
+     * or "/faces/foo.jsp" may be needed to access the view "/foo.jsp". 
+     */
     String calculateActionURL(FacesContext facesContext, String viewId); 
 }

Modified: myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java?rev=589835&r1=589834&r2=589835&view=diff
==============================================================================
--- myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java (original)
+++ myfaces/core/branches/1_2_1/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java Mon Oct 29 13:10:36 2007
@@ -272,6 +272,8 @@
      * <p>
      * URLs and ViewIds are not quite the same; for example a url of "/foo.jsf"
      * or "/faces/foo.jsp" may be needed to access the view "/foo.jsp". 
+     * <p>
+     * This method simply delegates to ViewHandlerSupport.calculateActionURL.
      */
     public String getActionURL(FacesContext facesContext, String viewId)
     {