|
1 | 1 | /* |
2 | 2 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 | 3 | * |
4 | | - * Copyright (c) 2012-2014 Oracle and/or its affiliates. All rights reserved. |
| 4 | + * Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved. |
5 | 5 | * |
6 | 6 | * The contents of this file are subject to the terms of either the GNU |
7 | 7 | * General Public License Version 2 only ("GPL") or the Common Development |
|
39 | 39 | */ |
40 | 40 | package org.glassfish.jersey.servlet; |
41 | 41 |
|
42 | | -import org.glassfish.hk2.api.ServiceLocator; |
43 | 42 | import org.glassfish.jersey.internal.util.PropertiesClass; |
44 | 43 |
|
| 44 | +import org.glassfish.hk2.api.ServiceLocator; |
| 45 | + |
45 | 46 | /** |
46 | 47 | * Jersey servlet container configuration properties. |
47 | 48 | * |
|
51 | 52 | public final class ServletProperties { |
52 | 53 |
|
53 | 54 | /** |
54 | | - * If set the regular expression is used to match an incoming servlet path URI |
55 | | - * to some web page content such as static resources or JSPs to be handled |
56 | | - * by the underlying servlet engine. |
57 | | - * <p></p> |
| 55 | + * If set, indicates the URL pattern of the Jersey servlet filter context path. |
| 56 | + * <p> |
| 57 | + * If the URL pattern of a filter is set to a base path and a wildcard, |
| 58 | + * such as "/base/*", then this property can be used to declare a filter |
| 59 | + * context path that behaves in the same manner as the Servlet context |
| 60 | + * path for determining the base URI of the application. (Note that with |
| 61 | + * the Servlet 2.x API it is not possible to determine the URL pattern |
| 62 | + * without parsing the {@code web.xml}, hence why this property is necessary.) |
| 63 | + * <p> |
58 | 64 | * The property is only applicable when {@link ServletContainer Jersey servlet |
59 | | - * container} is configured to run as a {@link javax.servlet.Filter}, otherwise |
60 | | - * this property will be ignored. If a servlet path matches this regular |
61 | | - * expression then the filter forwards the request to the next filter in the |
62 | | - * filter chain so that the underlying servlet engine can process the request |
63 | | - * otherwise Jersey will process the request. For example if you set the value |
64 | | - * to {@code /(image|css)/.*} then you can serve up images and CSS files |
65 | | - * for your Implicit or Explicit Views while still processing your JAX-RS |
66 | | - * resources. |
67 | | - * <p></p> |
68 | | - * The type of this property must be a String and the value must be a valid |
69 | | - * regular expression. |
| 65 | + * container} is configured to run as a {@link javax.servlet.Filter}, otherwise this property |
| 66 | + * will be ignored. |
| 67 | + * <p> |
| 68 | + * The value of the property may consist of one or more path segments separate by |
| 69 | + * {@code '/'}. |
70 | 70 | * <p></p> |
71 | 71 | * A default value is not set. |
72 | 72 | * <p></p> |
73 | 73 | * The name of the configuration property is <tt>{@value}</tt>. |
74 | 74 | */ |
75 | | - public static final String FILTER_STATIC_CONTENT_REGEX = "jersey.config.servlet.filter.staticContentRegex"; |
| 75 | + public static final String FILTER_CONTEXT_PATH = "jersey.config.servlet.filter.contextPath"; |
76 | 76 |
|
77 | 77 | /** |
78 | 78 | * If set to {@code true} and a 404 response with no entity body is returned |
@@ -100,27 +100,28 @@ public final class ServletProperties { |
100 | 100 | public static final String FILTER_FORWARD_ON_404 = "jersey.config.servlet.filter.forwardOn404"; |
101 | 101 |
|
102 | 102 | /** |
103 | | - * If set, indicates the URL pattern of the Jersey servlet filter context path. |
104 | | - * <p> |
105 | | - * If the URL pattern of a filter is set to a base path and a wildcard, |
106 | | - * such as "/base/*", then this property can be used to declare a filter |
107 | | - * context path that behaves in the same manner as the Servlet context |
108 | | - * path for determining the base URI of the application. (Note that with |
109 | | - * the Servlet 2.x API it is not possible to determine the URL pattern |
110 | | - * without parsing the {@code web.xml}, hence why this property is necessary.) |
111 | | - * <p> |
| 103 | + * If set the regular expression is used to match an incoming servlet path URI |
| 104 | + * to some web page content such as static resources or JSPs to be handled |
| 105 | + * by the underlying servlet engine. |
| 106 | + * <p></p> |
112 | 107 | * The property is only applicable when {@link ServletContainer Jersey servlet |
113 | | - * container} is configured to run as a {@link javax.servlet.Filter}, otherwise this property |
114 | | - * will be ignored. |
115 | | - * <p> |
116 | | - * The value of the property may consist of one or more path segments separate by |
117 | | - * {@code '/'}. |
| 108 | + * container} is configured to run as a {@link javax.servlet.Filter}, otherwise |
| 109 | + * this property will be ignored. If a servlet path matches this regular |
| 110 | + * expression then the filter forwards the request to the next filter in the |
| 111 | + * filter chain so that the underlying servlet engine can process the request |
| 112 | + * otherwise Jersey will process the request. For example if you set the value |
| 113 | + * to {@code /(image|css)/.*} then you can serve up images and CSS files |
| 114 | + * for your Implicit or Explicit Views while still processing your JAX-RS |
| 115 | + * resources. |
| 116 | + * <p></p> |
| 117 | + * The type of this property must be a String and the value must be a valid |
| 118 | + * regular expression. |
118 | 119 | * <p></p> |
119 | 120 | * A default value is not set. |
120 | 121 | * <p></p> |
121 | 122 | * The name of the configuration property is <tt>{@value}</tt>. |
122 | 123 | */ |
123 | | - public static final String FILTER_CONTEXT_PATH = "jersey.config.servlet.filter.contextPath"; |
| 124 | + public static final String FILTER_STATIC_CONTENT_REGEX = "jersey.config.servlet.filter.staticContentRegex"; |
124 | 125 |
|
125 | 126 | /** |
126 | 127 | * Application configuration initialization property whose value is a fully |
@@ -148,6 +149,20 @@ public final class ServletProperties { |
148 | 149 | */ |
149 | 150 | public static final String PROVIDER_WEB_APP = "jersey.config.servlet.provider.webapp"; |
150 | 151 |
|
| 152 | + /** |
| 153 | + * If {@code true} then query parameters will not be treated as form parameters (e.g. injectable using |
| 154 | + * {@link javax.ws.rs.FormParam}) in case a Form request is processed by server. |
| 155 | + * <p> |
| 156 | + * The default value is {@code false}. |
| 157 | + * </p> |
| 158 | + * <p> |
| 159 | + * The name of the configuration property is <tt>{@value}</tt>. |
| 160 | + * </p> |
| 161 | + * |
| 162 | + * @since 2.16 |
| 163 | + */ |
| 164 | + public static final String QUERY_PARAMS_AS_FORM_PARAMS_DISABLED = "jersey.config.servlet.form.queryParams.disabled"; |
| 165 | + |
151 | 166 | /** |
152 | 167 | * Identifies the object that will be used as a parent {@link ServiceLocator} in the Jersey |
153 | 168 | * {@link WebComponent}. |
|
0 commit comments