2
* $Header: /home/cvs/jakarta-struts/contrib/scaffold/src/java/org/apache/struts/scaffold/FindForwardAction.java,v 1.4 2004/03/14 07:15:03 sraeburn Exp $
4
* $Date: 2004/03/14 07:15:03 $
6
* Copyright 2001-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.
22
package org.apache.struts.scaffold;
25
import javax.servlet.http.HttpServletRequest;
26
import javax.servlet.http.HttpServletResponse;
28
import org.apache.struts.action.ActionForm;
29
import org.apache.struts.action.ActionForward;
30
import org.apache.struts.action.ActionMapping;
32
import org.apache.commons.scaffold.lang.Tokens;
36
* Scan request parameters for the name of a local or global
37
* forward. If one is found, use it. If not, return null.
39
* This class extends BaseAction to provide
40
* cross-compatibility with Struts 1.1 and 1.0
42
* @version $Revision: 1.4 $ $Date: 2004/03/14 07:15:03 $
44
public final class FindForwardAction extends BaseAction {
47
* Scan request parameters for the name of a local or global
48
* forward. If one is found, use it. If not, return null.
50
* @param mapping The ActionMapping used to select this instance
51
* @param form The optional ActionForm bean for this request (if any)
52
* @param request The HTTP request we are processing
53
* @param response The response we are creating
55
protected ActionForward findSuccess(
56
ActionMapping mapping,
58
HttpServletRequest request,
59
HttpServletResponse response) {
61
String forwards[] = mapping.findForwards();
63
/* -- non-deprecated version for 1.1
64
ApplicationConfig config = (ApplicationConfig)
65
request.getAttribute(Action.APPLICATION_KEY);
66
ForwardConfig forwards[] = config.findForwardConfigs();
69
for (int i=0; i<forwards.length; i++) {
70
if (request.getParameter(forwards[i])!=null) {
71
// Return the required ActionForward instance
72
return mapping.findForward(forwards[i]);
80
} // end FindForwardAction
b'\\ No newline at end of file'