1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
package net.sf.mindoro.web; |
8 |
|
|
9 |
|
import java.util.HashMap; |
10 |
|
import java.util.Map; |
11 |
|
|
12 |
|
import javax.servlet.http.HttpServletRequest; |
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
public final class WebUtil { |
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
0 |
private WebUtil() { |
26 |
|
|
27 |
0 |
} |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
public static Map getRequestProperties(final HttpServletRequest request) { |
35 |
0 |
final Map properties = new HashMap(); |
36 |
0 |
properties.put("authType", request.getAuthType()); |
37 |
0 |
properties.put("characterEncoding", request.getCharacterEncoding()); |
38 |
0 |
properties.put("contentType", request.getContentType()); |
39 |
0 |
properties.put("contextPath", request.getContextPath()); |
40 |
0 |
properties.put("locale", request.getLocale().getDisplayName()); |
41 |
0 |
properties.put("method", request.getMethod()); |
42 |
0 |
properties.put("pathInfo", request.getPathInfo()); |
43 |
0 |
properties.put("pathTranslated", request.getPathTranslated()); |
44 |
0 |
properties.put("protocol", request.getProtocol()); |
45 |
0 |
properties.put("queryString", request.getQueryString()); |
46 |
0 |
properties.put("remoteAddr", request.getRemoteAddr()); |
47 |
0 |
properties.put("remoteHost", request.getRemoteHost()); |
48 |
0 |
properties.put("remoteUser", request.getRemoteUser()); |
49 |
0 |
properties.put("requestedSessionId", request.getRequestedSessionId()); |
50 |
0 |
properties.put("requestURI", request.getRequestURI()); |
51 |
0 |
properties.put("requestURL", request.getRequestURL()); |
52 |
0 |
properties.put("scheme", request.getScheme()); |
53 |
0 |
properties.put("serverName", request.getServerName()); |
54 |
0 |
properties.put("servletPath", request.getServletPath()); |
55 |
0 |
properties.put("serverPort", String.valueOf(request.getServerPort())); |
56 |
0 |
return properties; |
57 |
|
} |
58 |
|
|
59 |
|
} |