]> git.argeo.org Git - lgpl/argeo-commons.git/blob - remote/ExtendedDispatcherServlet.java
Prepare next development cycle
[lgpl/argeo-commons.git] / remote / ExtendedDispatcherServlet.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
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.argeo.jackrabbit.remote;
18
19 import javax.servlet.ServletException;
20 import javax.servlet.http.HttpServletRequest;
21 import javax.servlet.http.HttpServletResponse;
22
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25 import org.argeo.ArgeoException;
26 import org.springframework.web.servlet.DispatcherServlet;
27
28 public class ExtendedDispatcherServlet extends DispatcherServlet {
29 private static final long serialVersionUID = -5584673209855752009L;
30
31 private final static Log log = LogFactory
32 .getLog(ExtendedDispatcherServlet.class);
33
34 protected void service(HttpServletRequest request,
35 HttpServletResponse response) throws ServletException,
36 java.io.IOException {
37
38 // see http://forum.springsource.org/showthread.php?t=53472
39 try {
40 if (log.isTraceEnabled()) {
41 log.trace("UserPrincipal = "
42 + request.getUserPrincipal().getName());
43 log.trace("SessionID = " + request.getSession().getId());
44 log.trace("ContextPath = " + request.getContextPath());
45 log.trace("ServletPath = " + request.getServletPath());
46 log.trace("PathInfo = " + request.getPathInfo());
47 log.trace("Method = " + request.getMethod());
48 log.trace("User-Agent = " + request.getHeader("User-Agent"));
49 }
50 doService(request, response);
51 } catch (Exception e) {
52 // e.printStackTrace();
53 // log.debug(request.getMethod());
54 throw new ArgeoException("Cannot process request", e);
55 }
56 }
57
58 }