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 $
4
* $Date: 2004/06/24 01:16:44 $
6
* Copyright 1999-2004 The Apache Software Foundation.
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
12
* http://www.apache.org/licenses/LICENSE-2.0
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.
21
package org.apache.struts.webapp.tiles.tutorial;
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;
30
public class ForwardExampleAction extends Action {
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.
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
44
* @exception Exception if the application business logic throws
47
public ActionForward execute(
48
ActionMapping mapping,
50
HttpServletRequest request,
51
HttpServletResponse response)
53
String success = request.getParameter( "success" );
55
return (mapping.findForward("success"));
57
return (mapping.findForward("failure"));