2
* $Header: /home/cvs/jakarta-struts/contrib/scaffold/src/java/org/apache/struts/scaffold/SetPathsAction.java,v 1.4 2004/03/14 07:15:03 sraeburn Exp $
4
* $Date: 2004/03/14 07:15:03 $
6
* Copyright 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.SetPathsAction;
24
import java.io.IOException;
26
import javax.servlet.ServletException;
27
import javax.servlet.http.HttpServletRequest;
28
import javax.servlet.http.HttpServletResponse;
30
import org.apache.struts.action.ActionForm;
31
import org.apache.struts.action.ActionMapping;
33
import org.apache.struts.scaffold.BaseAction;
34
import org.apache.commons.scaffold.lang.Log;
35
import org.apache.commons.scaffold.lang.Tokens;
39
* Standard Action to set the paths from
40
* enumerated forwards as request attributes.
42
* @version $Revision: 1.4 $ $Date: 2004/03/14 07:15:03 $
44
public final class SetPathsAction extends BaseAction {
48
* Lookup the forward each token given on the parameter property,
49
* and set its path as a request attribute under the token name.
51
* @param mapping The ActionMapping used to select this instance
52
* @param form The ActionForm
53
* @param request The HTTP request we are processing
54
* @param response The HTTP response we are creating
56
* @exception IOException if an input/output error occurs
57
* @exception ServletException if a servlet exception occurs
59
public void executeLogic(
60
ActionMapping mapping,
62
HttpServletRequest request,
63
HttpServletResponse response)
66
servlet.log(Log.TOKENS_PARSING,Log.DEBUG);
67
String[] tokens = tokenize(mapping.getParameter());
68
int helperCount = tokens.length;
70
for (int i=0; i<helperCount; i++) {
73
mapping.findForward(tokens[i]).getPath());
78
} // end SetPathsAction
b'\\ No newline at end of file'