KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > workbench > RequestDecoder


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

15 package org.apache.tapestry.workbench;
16
17 import javax.servlet.http.HttpServletRequest JavaDoc;
18
19 import org.apache.commons.logging.Log;
20 import org.apache.commons.logging.LogFactory;
21 import org.apache.tapestry.request.DecodedRequest;
22 import org.apache.tapestry.request.IRequestDecoder;
23
24 /**
25  * A useless request decoder (does the same as the default), used to test that a user-supplied
26  * extension is actually used.
27  *
28  * @author Howard Lewis Ship
29  * @since 2.2
30  */

31
32 public class RequestDecoder implements IRequestDecoder
33 {
34     private static final Log LOG = LogFactory.getLog(RequestDecoder.class);
35
36     public RequestDecoder()
37     {
38         LOG.debug("<init>");
39     }
40
41     public DecodedRequest decodeRequest(HttpServletRequest JavaDoc request)
42     {
43         if (LOG.isDebugEnabled())
44             LOG.debug("Decoding: " + request);
45
46         DecodedRequest result = new DecodedRequest();
47
48         result.setRequestURI(request.getRequestURI());
49         result.setScheme(request.getScheme());
50         result.setServerName(request.getServerName());
51         result.setServerPort(request.getServerPort());
52
53         return result;
54
55     }
56
57 }
Popular Tags