~ubuntu-branches/ubuntu/trusty/libstruts1.2-java/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tiles-documentation/org/apache/struts/webapp/tiles/tutorial/ForwardExampleAction.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2004-11-19 15:35:25 UTC
  • Revision ID: james.westby@ubuntu.com-20041119153525-mdu08a76z4zo67xt
Tags: upstream-1.2.4
ImportĀ upstreamĀ versionĀ 1.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Header: /home/cvs/jakarta-struts/src/tiles-documentation/org/apache/struts/webapp/tiles/tutorial/ForwardExampleAction.java,v 1.6 2004/06/24 01:16:44 jmitchell Exp $
 
3
 * $Revision: 1.6 $
 
4
 * $Date: 2004/06/24 01:16:44 $
 
5
 *
 
6
 * Copyright 1999-2004 The Apache Software Foundation.
 
7
 * 
 
8
 * Licensed under the Apache License, Version 2.0 (the "License");
 
9
 * you may not use this file except in compliance with the License.
 
10
 * You may obtain a copy of the License at
 
11
 * 
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 * 
 
14
 * Unless required by applicable law or agreed to in writing, software
 
15
 * distributed under the License is distributed on an "AS IS" BASIS,
 
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
17
 * See the License for the specific language governing permissions and
 
18
 * limitations under the License.
 
19
 */
 
20
 
 
21
package org.apache.struts.webapp.tiles.tutorial;
 
22
 
 
23
import javax.servlet.http.HttpServletRequest;
 
24
import javax.servlet.http.HttpServletResponse;
 
25
import org.apache.struts.action.Action;
 
26
import org.apache.struts.action.ActionForm;
 
27
import org.apache.struts.action.ActionForward;
 
28
import org.apache.struts.action.ActionMapping;
 
29
 
 
30
public class ForwardExampleAction extends Action {
 
31
 
 
32
    /**
 
33
     * Process the specified HTTP request, and create the corresponding HTTP
 
34
     * response (or forward to another web component that will create it).
 
35
     * Return an <code>ActionForward</code> instance describing where and how
 
36
     * control should be forwarded, or <code>null</code> if the response has
 
37
     * already been completed.
 
38
     *
 
39
     * @param mapping The ActionMapping used to select this instance
 
40
     * @param actionForm The optional ActionForm bean for this request (if any)
 
41
     * @param request The HTTP request we are processing
 
42
     * @param response The HTTP response we are creating
 
43
     *
 
44
     * @exception Exception if the application business logic throws
 
45
     *  an exception
 
46
     */
 
47
    public ActionForward execute(
 
48
                                 ActionMapping mapping,
 
49
                                 ActionForm form,
 
50
                                 HttpServletRequest request,
 
51
                                 HttpServletResponse response)
 
52
        throws Exception {
 
53
    String success = request.getParameter( "success" );
 
54
    if( success != null )
 
55
            return (mapping.findForward("success"));
 
56
 
 
57
    return (mapping.findForward("failure"));
 
58
    }
 
59
 
 
60
 }