KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > modules > input > RequestModule


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.cocoon.components.modules.input;
18
19 import org.apache.avalon.framework.configuration.Configuration;
20 import org.apache.avalon.framework.thread.ThreadSafe;
21 import org.apache.cocoon.environment.ObjectModelHelper;
22
23 import java.util.Map JavaDoc;
24
25 /**
26  * RequestModule provides access to Request object properties.
27  * To get access to request properties use XPath syntax, e.g. to get the request
28  * context path use <code>'contextPath'</code> as the attribute name.<br/>
29  * More complex expressions are also supported, e.g.:
30  * <pre>
31  * 'userPrincipal/name'
32  * </pre>
33  * will return the name property of the Principal object returned by the
34  * request.getUserPrincipal() method. If requested object is not found then
35  * an exception will be thrown.
36  *
37  * @author <a HREF="mailto:kpiroumian@apache.org">Konstantin Piroumian</a>
38  * @version CVS $Id: RequestModule.java 30932 2004-07-29 17:35:38Z vgritsenko $
39  */

40 public class RequestModule extends AbstractJXPathModule
41     implements ThreadSafe {
42
43     protected Object JavaDoc getContextObject(Configuration modeConf,
44                                       Map JavaDoc objectModel) {
45
46         return ObjectModelHelper.getRequest(objectModel);
47     }
48 }
49
Popular Tags