View Javadoc

1   /*
2    * $Id: DefaultAction.java 113 2004-10-22 19:22:56Z josem $
3    *
4    * Tarsis
5    * Copyright (C) 2002 Talika Open Source Group
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, write to the Free Software
19   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20   *
21   */
22  
23  package org.talika.tarsis.command.action;
24  
25  import org.talika.tarsis.command.Request;
26  import org.talika.tarsis.command.Response;
27  
28  /**
29   * Default implementation of <code>Action</code> interface.<br>
30   * <br>
31   * Defines all methods of action interface. The implementation of <code>validate</code>
32   * and <code>execute</code> are empty and do nothing.
33   *
34   * @author  Jose M. Palomar
35   * @version $Revision: 113 $
36   */
37  public class DefaultAction extends AbstractAction {
38  
39      /**
40       * Constructs a new <code>DefaultAction</code> object.
41       */
42      public DefaultAction() {
43      }
44  
45      /**
46       * Called by Tarsis MVC Framework to validate request everytime command is
47       * invoked.<br>
48       * <br>
49       * This method is called only if command is validable.<br>
50       * <br>
51       * This implementation do nothing.
52       *
53       * @param request Request object representing client's request.
54       * @throws ActionException if an exception has occurred that interferes with the
55       * action's normal operation.
56       * @see org.talika.tarsis.command.action.Action#validate(Request)
57       */
58      public void validate(Request request) throws ActionException {
59      }
60  
61      /**
62       * Called by Tarsis MVC Framework to handle request everytime command is
63       * invoked.<br>
64       * This implementation do nothing and returns <code>null</code>.
65       *
66       * @param request Request object representing client's request.
67       * @param response Response object representing client's reponse.
68       * @return String the name of view to be forwarded or <code>null</code> for
69       * default view.
70       * @throws ActionException if an exception has occurred that interferes with the
71       * action's normal operation.
72       * @see org.talika.tarsis.command.action.Action#execute(Request, Response)
73       */
74      public String execute(Request request, Response response) throws ActionException {
75          return null;
76      }
77  
78  }