Class ServerProperties
- java.lang.Object
-
- org.glassfish.jersey.server.ServerProperties
-
public final class ServerProperties extends Object
Jersey server-side configuration properties.- Author:
- Marek Potociar, Libor Kramolis, Michal Gajdos, Martin Matula
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPLICATION_NAMEStringproperty that defines the application name.static StringBV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECKA Bean Validation (JSR-349) support customization property.static StringBV_FEATURE_DISABLEIftruethen disable Bean Validation support.static StringBV_SEND_ERROR_IN_RESPONSEA Bean Validation (JSR-349) support customization property.static StringCOLLISION_BUFFER_POWER_JVM_ARGJVM argument to define the value ofReservoirConstants.COLLISION_BUFFER_POWER.static StringEMPTY_REQUEST_MEDIA_TYPE_MATCHES_ANY_CONSUMESJakarta RESTful WebServices provides@Consumesannotation to accept only HTTP requests with compatibleContent-Typeheader.static StringFEATURE_AUTO_DISCOVERY_DISABLEIftruethen disable auto discovery on server.static StringHTTP_METHOD_OVERRIDEDefines configuration of HTTP method overriding.static StringJSON_PROCESSING_FEATURE_DISABLEIftruethen disable configuration of Json Processing (JSR-353) feature on server.static StringLANGUAGE_MAPPINGSDefines mapping of URI extensions to languages.static StringLOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLEDIftruethen Jersey will not attempt to resolve relative URIs in theLocationhttp header against the request URI.static StringLOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231Iftruethen Jersey will resolve relative URIs in theLocationhttp header against the request URI according to RFC7231 (new HTTP Specification).static StringMEDIA_TYPE_MAPPINGSDefines mapping of URI extensions to media types.static StringMETAINF_SERVICES_LOOKUP_DISABLEIftruethen disable META-INF/services lookup on server.static StringMONITORING_ENABLEDIftruethen application monitoring will be enabled.static StringMONITORING_STATISTICS_ENABLEDIftruethen calculation of monitoring statistics will be enabled.static StringMONITORING_STATISTICS_MBEANS_ENABLEDIftruethen Jersey will expose MBeans with monitoring statistics.static StringMONITORING_STATISTICS_REFRESH_INTERVALInterval (inms) indicating how often will be monitoring statistics refreshed andonStatisticsmethod called.static StringMOXY_JSON_FEATURE_DISABLEIftruethen disable configuration of MOXy Json feature on server.static StringOUTBOUND_CONTENT_LENGTH_BUFFERAn integer value that defines the buffer size used to buffer server-side response entity in order to determine its size and set the value of HTTP "Content-Length" header.static StringPROCESSING_RESPONSE_ERRORS_ENABLEDIf property value istruethen the errors raised during response processing are tried to handled using availableresponse error mappers.static StringPROVIDER_CLASSNAMESDefines one or more class names that implement application-specific resources and providers.static StringPROVIDER_CLASSPATHDefines class-path that contains application-specific resources and providers.static StringPROVIDER_PACKAGESDefines one or more packages that contain application-specific resources and providers.static StringPROVIDER_SCANNING_RECURSIVESets the recursion strategy for package scanning.static StringREDUCE_CONTEXT_PATH_SLASHES_ENABLEDIf set totruethen a container will ignore multiple slashes between a port and a context path and will resolve it as URI with only one slash.static StringRESOURCE_VALIDATION_DISABLEIftruethen the extensive validation of application resource model is disabled.static StringRESOURCE_VALIDATION_IGNORE_ERRORSIftruethen validation of application resource models does not fail even in case of a fatal validation errors.static StringRESPONSE_SET_STATUS_OVER_SEND_ERRORWhenever response status is4xxor5xxit is possible to choose betweensendErrororsetStatuson container specificResponseimplementation.static StringSUBRESOURCE_LOCATOR_CACHE_AGEAn integer value that defines the maximum age (in seconds) for cached for sub-resource locator models.static StringSUBRESOURCE_LOCATOR_CACHE_JERSEY_RESOURCE_ENABLEDIftruethen Jersey will cacheJersey resourcesin addition to caching sub-resource locator classes and instances (which are cached by default).static StringSUBRESOURCE_LOCATOR_CACHE_SIZEAn integer value that defines the size of cache for sub-resource locator models.static intSUBRESOURCE_LOCATOR_DEFAULT_CACHE_SIZEThe default sub-resource locator cache size (64).static StringTRACINGEnable tracing support.static StringTRACING_THRESHOLDSet level o tracing information.static StringUNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLEIftruemessage body writer will not useCompletionStageas a generic type.static StringWADL_FEATURE_DISABLEIftruethen disable WADL generation.static StringWADL_GENERATOR_CONFIGIf set the wadl generator configuration that provides aWadlGenerator.static StringWEBSERVER_ALLOW_PRIVILEGED_PORTSDefines whether to allow privileged ports (0-1023) to be used to start theWebServerimplementation to be chosen from the unused ports when theSeBootstrap.Configuration.PORTis set to-1or unset.static StringWEBSERVER_AUTO_STARTWhether to automatically startupWebServerat bootstrap.static StringWEBSERVER_CLASSDefines the implementation ofWebServerto bootstrap.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetValue(Map<String,?> properties, jakarta.ws.rs.RuntimeType runtimeType, String key, T defaultValue, Class<T> type)Get the value of the specified property.static <T> TgetValue(Map<String,?> properties, String key, Class<T> type)Get the value of the specified property.static <T> TgetValue(Map<String,?> properties, String key, T defaultValue)Get the value of the specified property.static <T> TgetValue(Map<String,?> properties, String key, T defaultValue, Class<T> type)Get the value of the specified property.
-
-
-
Field Detail
-
PROVIDER_PACKAGES
public static final String PROVIDER_PACKAGES
Defines one or more packages that contain application-specific resources and providers. If the property is set, the specified packages will be scanned for JAX-RS root resources (annotated with@Path) and providers (annotated with@Provider).The property value MUST be an instance of
StringorString[]array. EachStringinstance represents one or more package names that MUST be separated only by characters declared in common delimiters:" ,;\n".A default value is not set.
The name of the configuration property is "jersey.config.server.provider.packages".
- See Also:
- Constant Field Values
-
PROVIDER_SCANNING_RECURSIVE
public static final String PROVIDER_SCANNING_RECURSIVE
Sets the recursion strategy for package scanning. The value oftrueindicates that thelist of provided package namesshould be scanned recursively including any nested packages. Value offalseindicates that only packages in the list should be scanned. In such case any nested packages will be ignored.The property value MUST be an instance of
Booleantype or aStringconvertible toBooleantype.A default value is
true.The name of the configuration property is "jersey.config.server.provider.scanning.recursive".
- See Also:
PROVIDER_PACKAGES, Constant Field Values
-
PROVIDER_CLASSPATH
public static final String PROVIDER_CLASSPATH
Defines class-path that contains application-specific resources and providers. If the property is set, the specified class-path will be scanned for JAX-RS root resources (annotated with@Path) and providers (annotated with@Provider). Each path element MUST be an absolute or relative directory, or a Jar file. The contents of a directory, including Java class files, jars files and sub-directories are scanned (recursively).The property value MUST be an instance of
StringorString[]array. EachStringinstance represents one or more paths that MUST be separated only by characters declared in common delimiters:" ,;\n".A default value is not set.
The name of the configuration property is "jersey.config.server.provider.classpath".
- See Also:
- Constant Field Values
-
PROVIDER_CLASSNAMES
public static final String PROVIDER_CLASSNAMES
Defines one or more class names that implement application-specific resources and providers. If the property is set, the specified classes will be instantiated and registered as either application JAX-RS root resources (annotated with@Path) or providers (annotated with@Provider).The property value MUST be an instance of
StringorString[]array. EachStringinstance represents one or more class names that MUST be separated only by characters declared in common delimiters:" ,;\n".A default value is not set.
The name of the configuration property is "jersey.config.server.provider.classnames".
- See Also:
- Constant Field Values
-
MEDIA_TYPE_MAPPINGS
public static final String MEDIA_TYPE_MAPPINGS
Defines mapping of URI extensions to media types. The property is used byUriConnegFilter. See it's javadoc for more information on media type mappings.The property value MUST be an instance of
String,String[]orMap<String, MediaType>. EachStringinstance represents one or more uri-extension-to-media-type map entries separated by a comma (","). Each map entry is a key-value pair separated by a colon (":"). Here is an example of an acceptable String value mapping txt extension to text/plain and xml extension to application/xml:txt : text/plain, xml : application/xml
A default value is not set.
The name of the configuration property is "jersey.config.server.mediaTypeMappings".
- See Also:
- Constant Field Values
-
LANGUAGE_MAPPINGS
public static final String LANGUAGE_MAPPINGS
Defines mapping of URI extensions to languages. The property is used byUriConnegFilter. See it's javadoc for more information on language mappings.The property value MUST be an instance of
String,String[]orMap<String, String>. EachStringinstance represents one or more uri-extension-to-language map entries separated by a comma (","). Each map entry is a key-value pair separated by a colon (":"). Here is an example of an acceptable String value mapping english extension to "en" value of Content-Language header and french extension to "fr" Content-Language header value:english : en, french : fr
A default value is not set.
The name of the configuration property is "jersey.config.server.languageMappings".
- See Also:
- Constant Field Values
-
HTTP_METHOD_OVERRIDE
public static final String HTTP_METHOD_OVERRIDE
Defines configuration of HTTP method overriding. This property is used byHttpMethodOverrideFilterto determine where it should look for method override information (e.g. request header or query parameters).HttpMethodOverrideFilter.Sourceenum lists the allowed property values.The property value must be an instance of
String,String[],SourceorSource[]. EachStringinstance represents one or more class names separated by characters declared in common delimiters:" ,;\n".The default value is
"HEADER, QUERY".The name of the configuration property is "jersey.config.server.httpMethodOverride".
- See Also:
- Constant Field Values
-
WADL_GENERATOR_CONFIG
public static final String WADL_GENERATOR_CONFIG
If set the wadl generator configuration that provides aWadlGenerator. If this property is not set the default wadl generator will be used for generating wadl.The type of this property must be a subclass or an instance of a subclass of
WadlGeneratorConfig.The name of the configuration property is "jersey.config.server.wadl.generatorConfig".
- See Also:
- Constant Field Values
-
WADL_FEATURE_DISABLE
public static final String WADL_FEATURE_DISABLE
Iftruethen disable WADL generation. By default WADL generation is automatically enabled, if JAXB is present in the classpath.The default value is
false.The name of the configuration property is "jersey.config.server.wadl.disableWadl".
- See Also:
- Constant Field Values
-
BV_FEATURE_DISABLE
public static final String BV_FEATURE_DISABLE
Iftruethen disable Bean Validation support. By default Bean Validation (JSR-349) is automatically enabled, iforg.glassfish.jersey.ext::jersey-bean-validationJersey module is present in the classpath.The default value is
false.The name of the configuration property is "jersey.config.beanValidation.disable.server".
- See Also:
- Constant Field Values
-
BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK
public static final String BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK
A Bean Validation (JSR-349) support customization property. Iftruethe check whether the overriding / implementing methods are annotated withValidateOnExecutionas well as one of their predecessor (in hierarchy) is disabled.By default this checks is automatically enabled, unless the Bean Validation support is disabled explicitly (see
BV_FEATURE_DISABLE).The default value is
false.The name of the configuration property is "jersey.config.beanValidation.disable.validateOnExecutableCheck.server".
- See Also:
ValidateOnExecution, Constant Field Values
-
BV_SEND_ERROR_IN_RESPONSE
public static final String BV_SEND_ERROR_IN_RESPONSE
A Bean Validation (JSR-349) support customization property. If set totrueand Bean Validation support has not been explicitly disabled (seeBV_FEATURE_DISABLE), the validation error information will be sent in the entity of the returnedResponse.The default value is
false. This means that in case of an error response caused by a Bean Validation error, only a status code is sent in the serverResponseby default.The name of the configuration property is "jersey.config.beanValidation.enableOutputValidationErrorEntity.server".
- See Also:
- Constant Field Values
-
REDUCE_CONTEXT_PATH_SLASHES_ENABLED
public static final String REDUCE_CONTEXT_PATH_SLASHES_ENABLED
If set totruethen a container will ignore multiple slashes between a port and a context path and will resolve it as URI with only one slash.The default value is
false. This means that in case of multiple slashes a container will match with the address with the same number of slashes before a context path.The property influences only Grizzly Container from containers which are supported by Jersey. Other containers have limited or disabled usage of a context path.
The name of the configuration property is "jersey.config.server.reduceContextPathSlashes.enabled".
- See Also:
- Constant Field Values
-
FEATURE_AUTO_DISCOVERY_DISABLE
public static final String FEATURE_AUTO_DISCOVERY_DISABLE
Iftruethen disable auto discovery on server. By default auto discovery is automatically enabled if global property "jersey.config.disableAutoDiscovery" is not disabled. If set then the server property value overrides the global property value.The default value is
false.The name of the configuration property is "jersey.config.server.disableAutoDiscovery".
This constant is an alias for
CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE_SERVER
-
OUTBOUND_CONTENT_LENGTH_BUFFER
public static final String OUTBOUND_CONTENT_LENGTH_BUFFER
An integer value that defines the buffer size used to buffer server-side response entity in order to determine its size and set the value of HTTP "Content-Length" header.If the entity size exceeds the configured buffer size, the buffering would be cancelled and the entity size would not be determined. Value less or equal to zero disable the buffering of the entity at all.
This property can be used on the server side to override the outbound message buffer size value - default or the global custom value set using the "jersey.config.contentLength.buffer" global property.The default value is 8192.
The name of the configuration property is "jersey.config.server.contentLength.buffer".
This constant is an alias for
CommonProperties.OUTBOUND_CONTENT_LENGTH_BUFFER_SERVER- Since:
- 2.2
- See Also:
- Constant Field Values
-
JSON_PROCESSING_FEATURE_DISABLE
public static final String JSON_PROCESSING_FEATURE_DISABLE
Iftruethen disable configuration of Json Processing (JSR-353) feature on server. By default Json Processing is automatically enabled if global property "jersey.config.disableJsonProcessing" is not disabled. If set then the server property value overrides the global property value.The default value is
false.The name of the configuration property is "jersey.config.server.disableJsonProcessing".
This constant is an alias for
CommonProperties.JSON_PROCESSING_FEATURE_DISABLE_SERVER
-
METAINF_SERVICES_LOOKUP_DISABLE
public static final String METAINF_SERVICES_LOOKUP_DISABLE
Iftruethen disable META-INF/services lookup on server. By default Jersey looks up SPI implementations described by META-INF/services/* files. Then you can register appropriate provider classes byApplication.The default value is
false.The name of the configuration property is "jersey.config.server.disableMetainfServicesLookup".
This constant is an alias for
CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE_SERVER- Since:
- 2.1
- See Also:
CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, Constant Field Values
-
MOXY_JSON_FEATURE_DISABLE
public static final String MOXY_JSON_FEATURE_DISABLE
Iftruethen disable configuration of MOXy Json feature on server. By default MOXy Json is automatically enabled if global property "jersey.config.disableMoxyJson" is not disabled. If set then the server property value overrides the global property value.The default value is
false.The name of the configuration property is "jersey.config.server.disableMoxyJson".
This constant is an alias for
CommonProperties.MOXY_JSON_FEATURE_DISABLE_SERVER
-
RESOURCE_VALIDATION_DISABLE
public static final String RESOURCE_VALIDATION_DISABLE
Iftruethen the extensive validation of application resource model is disabled. This impacts both the validation of root resources during deployment as well as validation of any sub resources returned from sub-resource locators.This option is typically used for performance purpose. Note however that in case the application resource models are not valid, setting the property to
truecan cause invalid behaviour and hard to diagnose issues at runtime.By default the resource validation is run on models which are created either from the supplied resource class or instance as well as on any directly provided
resourcemodels.The default value is
false.The name of the configuration property is "jersey.config.server.resource.validation.disable".
-
RESOURCE_VALIDATION_IGNORE_ERRORS
public static final String RESOURCE_VALIDATION_IGNORE_ERRORS
Iftruethen validation of application resource models does not fail even in case of a fatal validation errors. All resource model validation issues are still output to the log, unless the resource model validation is completely disabled (seeRESOURCE_VALIDATION_DISABLE). This impacts both the validation of root resources during deployment as well as validation of any sub resources returned from sub-resource locators. The option is typically used during development and testing.The default value is
false.The name of the configuration property is "jersey.config.server.resource.validation.ignoreErrors".
- See Also:
RESOURCE_VALIDATION_DISABLE, Constant Field Values
-
MONITORING_ENABLED
public static final String MONITORING_ENABLED
Iftruethen application monitoring will be enabled. This will enable the possibility of injectingApplicationInfointo resource and providers.The default value is
false.The name of the configuration property is "jersey.config.server.monitoring.enabled".
- Since:
- 2.12
- See Also:
- Constant Field Values
-
MONITORING_STATISTICS_ENABLED
public static final String MONITORING_STATISTICS_ENABLED
Iftruethen calculation of monitoring statistics will be enabled. This will enable the possibility of injectingMonitoringStatisticsinto resource and providers and also the registered listeners implementingMonitoringStatisticsListenerwill be called when statistics are available. Monitoring statistics extends basic monitoring feature. Therefore when enabled, the monitoring gets automatically enabled too (the same result as setting the propertyMONITORING_ENABLEDtrue). Enabling statistics has negative performance impact and therefore should be enabled only when needed.The default value is
false.The name of the configuration property is "jersey.config.server.monitoring.statistics.enabled".
-
MONITORING_STATISTICS_MBEANS_ENABLED
public static final String MONITORING_STATISTICS_MBEANS_ENABLED
Iftruethen Jersey will expose MBeans with monitoring statistics. Exposed JMX MBeans are based onMonitoringStatisticsand therefore when they are enabled, also the calculation of monitoring statistics needs to be enabled. Therefore if this property istruethe calculation of monitoring statistics is automatically enabled (the same result as setting the propertyMONITORING_STATISTICS_ENABLEDtotrue). Enabling statistics MBeans has negative performance impact and therefore should be enabled only when needed.The default value is
false.The name of the configuration property is "jersey.config.server.monitoring.statistics.mbeans.enabled".
-
MONITORING_STATISTICS_REFRESH_INTERVAL
public static final String MONITORING_STATISTICS_REFRESH_INTERVAL
Interval (inms) indicating how often will be monitoring statistics refreshed andonStatisticsmethod called. The default value is500. The name of the configuration property is "jersey.config.server.monitoring.statistics.refresh.interval".- Since:
- 2.10
- See Also:
- Constant Field Values
-
APPLICATION_NAME
public static final String APPLICATION_NAME
Stringproperty that defines the application name. The name is an arbitrary user defined name which is used to distinguish between Jersey applications in the case that more applications are deployed on the same runtime (container). The name can be used for example for purposes of monitoring by JMX when name identifies to which application deployed MBeans belong to. The name should be unique in the runtime.The property is ignored if the application name is set programmatically by
ResourceConfig.getApplicationName().There is no default value.
The name of the configuration property is "jersey.config.server.application.name".
- See Also:
- Constant Field Values
-
TRACING
public static final String TRACING
Enable tracing support. It allows service developer to get diagnostic information about request processing by Jersey. Those diagnostic/tracing information are returned in response headers (X-Jersey-Tracing-nnn). The feature should not be switched on on production environment.Allowed values:
OFF- tracing support is disabled.ON_DEMAND- tracing support is in 'stand by' mode, it is enabled on demand by existence of request HTTP headerALL- tracing support is enabled for every request.
String. The default value is"OFF".The name of the configuration property is "jersey.config.server.tracing.type".
- Since:
- 2.3
- See Also:
- Constant Field Values
-
TRACING_THRESHOLD
public static final String TRACING_THRESHOLD
Set level o tracing information. The property allows to set application default level o diagnostic information. Tracing level can be changed for each request by specifying request HTTP headerX-Jersey-Tracing-Threshold.Allowed values:
SUMMARYTRACEVERBOSE
String. The default value is"TRACE".The name of the configuration property is "jersey.config.server.tracing.threshold".
- Since:
- 2.3
- See Also:
TRACING, Constant Field Values
-
RESPONSE_SET_STATUS_OVER_SEND_ERROR
public static final String RESPONSE_SET_STATUS_OVER_SEND_ERROR
Whenever response status is4xxor5xxit is possible to choose betweensendErrororsetStatuson container specificResponseimplementation. E.g. on servlet container Jersey can callHttpServletResponse.setStatus(...)orHttpServletResponse.sendError(...).Calling
sendError(...)method usually resets entity, response headers and provide error page for specified status code (e.g. servleterror-pageconfiguration). However if you want to post-process response (e.g. by servlet filter) the only way to do it is callingsetStatus(...)on container Response object.If property value is
truethe methodResponse.setStatus(...)is used over defaultResponse.sendError(...).Type of the property value is
boolean. The default value isfalse.The name of the configuration property is "jersey.config.server.response.setStatusOverSendError".
- Since:
- 2.5
- See Also:
- Constant Field Values
-
PROCESSING_RESPONSE_ERRORS_ENABLED
public static final String PROCESSING_RESPONSE_ERRORS_ENABLED
If property value istruethen the errors raised during response processing are tried to handled using availableresponse error mappers.Type of the property value is
boolean. The default value isfalse.The name of the configuration property is "jersey.config.server.exception.processResponseErrors".
- Since:
- 2.8
- See Also:
- Constant Field Values
-
SUBRESOURCE_LOCATOR_CACHE_SIZE
public static final String SUBRESOURCE_LOCATOR_CACHE_SIZE
An integer value that defines the size of cache for sub-resource locator models. The cache is used to provide better performance for application that uses JAX-RS sub-resource locators.The default value is 64.
The name of the configuration property is "jersey.config.server.subresource.cache.size".
- Since:
- 2.16
- See Also:
SUBRESOURCE_LOCATOR_DEFAULT_CACHE_SIZE,SUBRESOURCE_LOCATOR_CACHE_AGE, Constant Field Values
-
SUBRESOURCE_LOCATOR_DEFAULT_CACHE_SIZE
public static final int SUBRESOURCE_LOCATOR_DEFAULT_CACHE_SIZE
The default sub-resource locator cache size (64).- Since:
- 2.16
- See Also:
SUBRESOURCE_LOCATOR_CACHE_SIZE, Constant Field Values
-
SUBRESOURCE_LOCATOR_CACHE_AGE
public static final String SUBRESOURCE_LOCATOR_CACHE_AGE
An integer value that defines the maximum age (in seconds) for cached for sub-resource locator models. The age of an cache entry is defined as the time since the last access (read) to the entry in the cache.Entry aging is not enabled by default.
The name of the configuration property is "jersey.config.server.subresource.cache.age".
- Since:
- 2.16
- See Also:
SUBRESOURCE_LOCATOR_CACHE_SIZE, Constant Field Values
-
SUBRESOURCE_LOCATOR_CACHE_JERSEY_RESOURCE_ENABLED
public static final String SUBRESOURCE_LOCATOR_CACHE_JERSEY_RESOURCE_ENABLED
Iftruethen Jersey will cacheJersey resourcesin addition to caching sub-resource locator classes and instances (which are cached by default). To make sure the caching is effective in this case you need to return same Jersey Resource instances for same input parameters from resource method. This means that generating new Jersey Resource instances for same input parameters would not have any performance effect and it would only fill-up the cache.The default value is
false.The name of the configuration property is "jersey.config.server.subresource.cache.jersey.resource.enabled".
- See Also:
- Constant Field Values
-
LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231
public static final String LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231
Iftruethen Jersey will resolve relative URIs in theLocationhttp header against the request URI according to RFC7231 (new HTTP Specification).This behaviour violates the JAX-RS 2.0 specification (which dates older than RFC7231). If
LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLEDis set totrue, value of this property is not taken into account.The default value is
false(JAX-RS 2.0 compliant).The name of the configuration property is "jersey.config.server.headers.location.relative.resolution.rfc7231".
- Since:
- 2.22.1
- See Also:
- Constant Field Values
-
LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED
public static final String LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED
Iftruethen Jersey will not attempt to resolve relative URIs in theLocationhttp header against the request URI.The default value is
false.The name of the configuration property is "jersey.config.server.headers.location.relative.resolution.disabled".
- Since:
- 2.22
- See Also:
- Constant Field Values
-
UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE
public static final String UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE
Iftruemessage body writer will not useCompletionStageas a generic type. TheCompletionStagevalue will be unwrapped and the message body writer will be invoked with the unwrapped type.The default value is
true.The name of the configuration property is "jersey.config.server.unwrap.completion.stage.writer.enable".
- Since:
- 2.33
- See Also:
- Constant Field Values
-
EMPTY_REQUEST_MEDIA_TYPE_MATCHES_ANY_CONSUMES
public static final String EMPTY_REQUEST_MEDIA_TYPE_MATCHES_ANY_CONSUMES
Jakarta RESTful WebServices provides
@Consumesannotation to accept only HTTP requests with compatibleContent-Typeheader. However, when the header is missing a wildcard media type is used to match the@Consumesannotation.HTTP/1.1 RFCrecommends that missing
Content-Typeheader MAY default toapplication/octet-stream. This property makes Jersey consider the missing HTTPContent-Typeheader to beapplication/octet-streamrather than a wildcard media type. However, for a resource method without an entity argument, such as for HTTP GET, a wildcard media type is still considered to accept the HTTP request for the missing HTTPContent-Typeheader.Set this property to false, if the empty request media type should not to match applied
@Consumesannotation on a resource method with an entity argument. The default istrue. The name of the configuration property is "jersey.config.server.empty.request.media.matches.any.consumes".- Since:
- 3.1.0
- See Also:
- Constant Field Values
-
WEBSERVER_ALLOW_PRIVILEGED_PORTS
public static final String WEBSERVER_ALLOW_PRIVILEGED_PORTS
Defines whether to allow privileged ports (0-1023) to be used to start theWebServerimplementation to be chosen from the unused ports when theSeBootstrap.Configuration.PORTis set to-1or unset.The default ports are
Container.DEFAULT_HTTP_PORTfor HTTP andContainer.DEFAULT_HTTPS_PORTfor HTTPS whenWEBSERVER_ALLOW_PRIVILEGED_PORTSistrueor 8080 for HTTP and 8443 for HTTPS whenWEBSERVER_ALLOW_PRIVILEGED_PORTSisfalse.If
SeBootstrap.Configuration.PORTis set to0, the implementation chooses random ports (0-65535) whenWEBSERVER_ALLOW_PRIVILEGED_PORTSistrue, or (1024-65535) whenWEBSERVER_ALLOW_PRIVILEGED_PORTSisfalse.The default this is
false. Usetrueto allow a restricted port number. The name of the configuration property is "jersey.config.server.bootstrap.webserver.allow.privileged.ports".- Since:
- 3.1.0
- See Also:
- Constant Field Values
-
WEBSERVER_AUTO_START
public static final String WEBSERVER_AUTO_START
Whether to automatically startupWebServerat bootstrap.By default, servers are immediately listening to connections after bootstrap, so no explicit invocation of
WebServer.start()is needed. The name of the configuration property is "jersey.config.server.bootstrap.webserver.autostart".- Since:
- 3.1.0
- See Also:
- Constant Field Values
-
WEBSERVER_CLASS
public static final String WEBSERVER_CLASS
Defines the implementation ofWebServerto bootstrap.By default auto-selects the first server provider found. The name of the configuration property is "jersey.config.server.bootstrap.webserver.class".
- Since:
- 3.1.0
- See Also:
- Constant Field Values
-
COLLISION_BUFFER_POWER_JVM_ARG
public static final String COLLISION_BUFFER_POWER_JVM_ARG
JVM argument to define the value ofReservoirConstants.COLLISION_BUFFER_POWER. Lower values reduce the memory footprint.- See Also:
- Constant Field Values
-
-
Method Detail
-
getValue
public static <T> T getValue(Map<String,?> properties, String key, Class<T> type)
Get the value of the specified property. If the property is not set or the real value type is not compatible with the specified value type, returnsnull.- Type Parameters:
T- Type of the property value.- Parameters:
properties- Map of properties to get the property value from.key- Name of the property.type- Type to retrieve the value as.- Returns:
- Value of the property or
null. - Since:
- 2.8
-
getValue
public static <T> T getValue(Map<String,?> properties, String key, T defaultValue)
Get the value of the specified property. If the property is not set or the real value type is not compatible withdefaultValuetype, the specifieddefaultValueis returned. Calling this method is equivalent to callingServerProperties.getValue(properties, key, defaultValue, (Class<T>) defaultValue.getClass()).- Type Parameters:
T- Type of the property value.- Parameters:
properties- Map of properties to get the property value from.key- Name of the property.defaultValue- Default value if property is not registered- Returns:
- Value of the property or
null. - Since:
- 2.8
-
getValue
public static <T> T getValue(Map<String,?> properties, String key, T defaultValue, Class<T> type)
Get the value of the specified property. If the property is not set or the real value type is not compatible with the specified value type, returnsdefaultValue.- Type Parameters:
T- Type of the property value.- Parameters:
properties- Map of properties to get the property value from.key- Name of the property.defaultValue- Default value if property is not registeredtype- Type to retrieve the value as.- Returns:
- Value of the property or
null. - Since:
- 2.8
-
getValue
public static <T> T getValue(Map<String,?> properties, jakarta.ws.rs.RuntimeType runtimeType, String key, T defaultValue, Class<T> type)
Get the value of the specified property. If the property is not set or the real value type is not compatible with the specified value type, returnsdefaultValue.- Type Parameters:
T- Type of the property value.- Parameters:
properties- Map of properties to get the property value from.runtimeType- Runtime type which is used to check whether there is a property with the samekeybut post-fixed by runtime type (.server or.client) which would override thekeyproperty.key- Name of the property.defaultValue- Default value if property is not registeredtype- Type to retrieve the value as.- Returns:
- Value of the property or
null. - Since:
- 2.8
-
-