01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.taglib.test.acting;
18:
19: import java.util.ArrayList;
20: import java.util.Enumeration;
21: import java.util.List;
22: import java.util.Map;
23:
24: import org.apache.avalon.framework.parameters.Parameters;
25: import org.apache.avalon.framework.thread.ThreadSafe;
26: import org.apache.cocoon.acting.ServiceableAction;
27: import org.apache.cocoon.environment.ObjectModelHelper;
28: import org.apache.cocoon.environment.Redirector;
29: import org.apache.cocoon.environment.Request;
30: import org.apache.cocoon.environment.Session;
31: import org.apache.cocoon.environment.SourceResolver;
32:
33: /**
34: * @author ?
35: * @version CVS $Id: TagtestAction.java 433543 2006-08-22 06:22:54Z crossley $
36: */
37: public class TagtestAction extends ServiceableAction implements
38: ThreadSafe {
39:
40: /*
41: * @see Action#act(Redirector, SourceResolver, Map, String, Parameters)
42: */
43: public Map act(Redirector redirector, SourceResolver resolver,
44: Map objectModel, String source, Parameters par)
45: throws Exception {
46: Request request = ObjectModelHelper.getRequest(objectModel);
47: Session session = request.getSession();
48: Enumeration locales = request.getLocales();
49: List info = new ArrayList();
50:
51: request.setAttribute("BrowserLocales", locales);
52:
53: info.add(request.getRemoteAddr());
54: info.add(request.getRemoteHost());
55: info.add(request.getRemoteUser());
56: info.add(request.getContentType());
57: info.add(request.getLocale());
58:
59: session.setAttribute("RequestInfo", info);
60: return null;
61: }
62: }
|