Commits

plightbo  committed 83e26e3
  • Participants
  • Parent commits 79bb3f1

Comments (0)

Files changed (4)

File src/java/com/opensymphony/webwork/dispatcher/ServletDispatcherResult.java

 import javax.servlet.jsp.PageContext;
 
 /**
- * Pulls the HttpServletRequest and HttpServletResponse objects from the action context and creates a
- * RequestDispatcher to the location specified as the parameter "location" and then forwards it. The
- * following parameter is required:
- *
- * <ul><li>location - the page or resource to dispatch to</li></ul>
+ * Includes or forwards a view. There are three possible ways the result can be executed:
+ * <ul>
+ *  <li>If we are in the scope of a JSP (a PageContext is available), PageContext's
+ *      {@link PageContext#include(java.lang.String) include} method is called.</li>
+ *  <li>If there is no PageContext and we're not in any sort of include (there is no
+ *      "javax.servlet.include.servlet_path" in the request attributes), then a call to
+ *      {@link RequestDispatcher#forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse) forward}
+ *      is made</li>
+ *  <li>Otherwise, {@link RequestDispatcher#include(javax.servlet.ServletRequest, javax.servlet.ServletResponse) include}
+ *      is called.</li>
+ * </ul>
  *
  * @see javax.servlet.RequestDispatcher
  * @author Patrick Lightbody

File src/java/com/opensymphony/webwork/dispatcher/ServletRedirectResult.java

 
 
 /**
- * Pulls the HttpServletResponse object from the action context,
- * and calls sendRedirect() using the location specified as the
- * parameter "location". The following params are required:
- * <ul>
- *  <li>location - the URL to use when calling sendRedirect()</li>
- * </ul>
+ * Calls the {@link HttpServletResponse#sendRedirect(java.lang.String) sendRedirect} method to the location specified.
+ *
+ * This result follows the same rules from {@link WebWorkResultSupport}.
  *
  * @author $Author$
  * @version $Revision$

File src/java/com/opensymphony/webwork/dispatcher/VelocityResult.java

 
 
 /**
- * Pulls the HttpServletResponse object from the action context,
- * and calls sendRedirect() using the location specified as the
- * parameter "location". The following params are required:
- * <ul>
- *  <li>location - the URL to use when calling sendRedirect()</li>
- * </ul>
+ * Using the Servlet container's {@link JspFactory}, this result mocks a JSP execution environment
+ * and then displays a Velocity template that will be streamed directly to the servlet output.
+ *
+ * This result follows the same rules from {@link WebWorkResultSupport}.
  *
- * @version $Id$
  * @author Matt Ho <a href="mailto:matt@indigoegg.com">&lt;matt@indigoegg.com&gt;</a>
  */
 public class VelocityResult extends WebWorkResultSupport {

File src/java/com/opensymphony/webwork/dispatcher/WebWorkResultSupport.java

 import com.opensymphony.xwork.util.TextParseUtil;
 
 /**
- * A base class for all WebWork action execution results. This class provides two common parameters for any
- * subclass: <ul>
+ * A base class for all WebWork action execution results.
+ * The "location" param is the default parameter, meaning the most common usage of this result would be:
  *
- *      <li>location - the location to go to after execution (could be a jsp page or another action)</li>
- *      <li>parse - <tt>true</tt> if the location should be parsed as an OGNL expression, <tt>false</tt> if not
- *              (default is <tt>false</tt>)</li></ul>
+ * This class provides two common parameters for any subclass:
+ * <ul>
+ *  <li>location - the location to go to after execution (could be a jsp page or another action).
+ *      It can be parsed as per the rules definied in the
+ *      {@link TextParseUtil#translateVariables(java.lang.String, com.opensymphony.xwork.util.OgnlValueStack) translateVariables}
+ *      method</li>
+ *  <li>parse - true by default. If set to false, the location param will not be parsed for expressions</li>
+ * </ul>
  *
  * In the xwork.xml configuration file, these would be included as:
  *
  *  &lt;/result&gt;</pre>
  *
  * or
+ *
  * <pre>
  *  &lt;result name="success" type="redirect" &gt;
  *      &lt;param name="<b>location</b>"&gt;foo.jsp&lt;/param&gt;
- *      &lt;param name="<b>parse</b>"&gt;true&lt;/param&gt;
+ *      &lt;param name="<b>parse</b>"&gt;false&lt;/param&gt;
  *  &lt;/result&gt;</pre>
  *
+ * or when using the default parameter feature
+ *
+ * <pre>
+ *  &lt;result name="success" type="redirect"&gt;<b>foo.jsp</b>&lt;/result&gt;</pre>
+ *
  * You should subclass this class if you're interested in adding more parameters or functionality
  * to your Result. If you do subclass this class you will need to
  * override {@link #doExecute(String, ActionInvocation)}.<p>