dgraham     2003/07/09 20:01:27

  Modified:    src/share/org/apache/struts/tiles/actions TilesAction.java
  Log:
  Formatted code.
  
  Revision  Changes    Path
  1.6       +76 -75    
jakarta-struts/src/share/org/apache/struts/tiles/actions/TilesAction.java
  
  Index: TilesAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/actions/TilesAction.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TilesAction.java  27 Feb 2003 19:20:36 -0000      1.5
  +++ TilesAction.java  10 Jul 2003 03:01:27 -0000      1.6
  @@ -59,19 +59,19 @@
    *
    */
   
  -
   package org.apache.struts.tiles.actions;
   
  -import org.apache.struts.tiles.ComponentContext;
  -
   import java.io.IOException;
  +
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  +
   import org.apache.struts.action.Action;
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
  +import org.apache.struts.tiles.ComponentContext;
   
   /**
    * Base class for Tiles Actions.
  @@ -81,70 +81,70 @@
    * This class extends Struts Action. Subclasses should override
    * execute(ComponentContext ...) method instead of Struts
    * execute(ActionMapping ...) method.
  - * Backward compatibility is ensured with the perform(ComponentContext ...) method.
    * @version $Revision$ $Date$
    */
  +public abstract class TilesAction extends Action {
   
  -public abstract class TilesAction extends Action
  -{
  +    /**
  +     * Original Struts Action's method.
  +     * Retrieve current Tile context and call TilesAction execute method.
  +     * Do not overload this method !
  +     *
  +     * @param mapping The ActionMapping used to select this instance.
  +     * @param form The optional ActionForm bean for this request (if any).
  +     * @param request The HTTP request we are processing.
  +     * @param response The HTTP response we are creating.
  +     *
  +     * @exception Exception if the application business logic throws
  +     *  an exception
  +     * @since Struts 1.1
  +     */
  +    public ActionForward execute(
  +        ActionMapping mapping,
  +        ActionForm form,
  +        HttpServletRequest request,
  +        HttpServletResponse response)
  +        throws Exception {
  +            
  +        // Try to retrieve tile context
  +        ComponentContext context = ComponentContext.getContext(request);
  +        if (context == null) {
  +            throw new ServletException(
  +                "Can't find Tile context for '"
  +                    + this.getClass().getName()
  +                    + "'. TilesAction subclasses must be called from a Tile");
  +        }
  +        
  +        return this.execute(context, mapping, form, request, response);
  +    }
   
  -  /**
  -   * Original Struts Action's method.
  -   * Retrieve current Tile context and call TilesAction execute method.
  -   * Do not overload this method !
  -   *
  -   * @param mapping The ActionMapping used to select this instance.
  -   * @param form The optional ActionForm bean for this request (if any).
  -   * @param request The HTTP request we are processing.
  -   * @param response The HTTP response we are creating.
  -   *
  -   * @exception Exception if the application business logic throws
  -   *  an exception
  -   * @since Struts 1.1
  -   */
  -  public ActionForward execute(ActionMapping mapping,
  -                               ActionForm form,
  -                               HttpServletRequest request,
  -                               HttpServletResponse response)
  -      throws Exception
  -  {
  -    // Try to retrieve tile context
  -  ComponentContext context = ComponentContext.getContext( request );
  -    if( context == null )
  -      {
  -      throw new ServletException( "Can't find Tile context for '" + 
this.getClass().getName()
  -                                + "'. TilesAction subclasses must be called from a 
Tile" );
  -      }
  -  return execute( context, mapping, form, request, response );
  -  }
  -
  -  /**
  -   * Process the specified HTTP request and create the corresponding HTTP
  -   * response (or forward to another web component that will create it),
  -   * with provision for handling exceptions thrown by the business logic.
  -   * <br>
  -   * Override this method to provide functionality.
  -   *
  -   * @param context The current Tile context, containing Tile attributes.
  -   * @param mapping The ActionMapping used to select this instance.
  -   * @param form The optional ActionForm bean for this request (if any).
  -   * @param request The HTTP request we are processing.
  -   * @param response The HTTP response we are creating.
  -   *
  -   * @exception Exception if the application business logic throws
  -   *  an exception
  -   * @since Struts 1.1
  -   */
  -  public ActionForward execute(ComponentContext context,
  -                               ActionMapping mapping,
  -                               ActionForm form,
  -                               HttpServletRequest request,
  -                               HttpServletResponse response)
  -      throws Exception
  -  {
  -    // Call old method for backward compatibility.
  -  return perform( context, mapping, form, request, response );
  -  }
  +    /**
  +     * Process the specified HTTP request and create the corresponding HTTP
  +     * response (or forward to another web component that will create it),
  +     * with provision for handling exceptions thrown by the business logic.
  +     * <br>
  +     * Override this method to provide functionality.
  +     *
  +     * @param context The current Tile context, containing Tile attributes.
  +     * @param mapping The ActionMapping used to select this instance.
  +     * @param form The optional ActionForm bean for this request (if any).
  +     * @param request The HTTP request we are processing.
  +     * @param response The HTTP response we are creating.
  +     *
  +     * @exception Exception if the application business logic throws
  +     *  an exception
  +     * @since Struts 1.1
  +     */
  +    public ActionForward execute(
  +        ComponentContext context,
  +        ActionMapping mapping,
  +        ActionForm form,
  +        HttpServletRequest request,
  +        HttpServletResponse response)
  +        throws Exception {
  +            
  +        return perform(context, mapping, form, request, response);
  +    }
   
       /**
        * Process the specified HTTP request and create the corresponding HTTP
  @@ -163,14 +163,15 @@
        * @exception ServletException if a servlet exception occurs
        * @deprecated Use the <code>execute()</code> method instead
        */
  -    public ActionForward perform( ComponentContext context,
  -                                 ActionMapping mapping,
  -                                 ActionForm form,
  -                                 HttpServletRequest request,
  -                                 HttpServletResponse response)
  -                          throws IOException, ServletException
  -    {
  -    return null;
  +    public ActionForward perform(
  +        ComponentContext context,
  +        ActionMapping mapping,
  +        ActionForm form,
  +        HttpServletRequest request,
  +        HttpServletResponse response)
  +        throws IOException, ServletException {
  +            
  +        return null;
       }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to