org.glassfish.jersey.server.spring.scope.RequestContextFilter Java Examples

The following examples show how to use org.glassfish.jersey.server.spring.scope.RequestContextFilter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RestResourceConfig.java    From Cheddar with Apache License 2.0 6 votes vote down vote up
@Autowired
public RestResourceConfig(final ApplicationContext applicationContext) {
    property("contextConfig", applicationContext);
    scanner = new ClassPathScanningCandidateComponentProvider(true);
    scanner.resetFilters(false);
    scanner.addIncludeFilter(new AnnotationTypeFilter(Path.class));
    scanner.addIncludeFilter(new AnnotationTypeFilter(Provider.class));
    register(RequestContextFilter.class);
    register(MultiPartFeature.class);
    register(ObjectMapperProvider.class);
    register(JacksonFeature.class);
    registerResources("com.clicktravel.cheddar.rest.exception.mapper", "com.clicktravel.cheddar.server.http.filter",
            "com.clicktravel.cheddar.server.rest.resource.status", "com.clicktravel.services",
            "com.clicktravel.cheddar.rest.body.writer");
    property(ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED, true);
    property(ServerProperties.WADL_FEATURE_DISABLE, true);
}
 
Example #2
Source File: JerseyConfig.java    From devicehive-java-server with Apache License 2.0 6 votes vote down vote up
public JerseyConfig() {
    scan("com.devicehive.resource.converters",
            "com.devicehive.resource.exceptions",
            "com.devicehive.resource.filter");

    registerClasses(AuthApiInfoResourceImpl.class,
            JwtTokenResourceImpl.class);

    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

    register(RequestContextFilter.class);
    register(LoggingFeature.class);
    register(ContentTypeFilter.class);

    register(io.swagger.jaxrs.listing.ApiListingResource.class);
    register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
}
 
Example #3
Source File: JerseyConfig.java    From devicehive-java-server with Apache License 2.0 6 votes vote down vote up
public JerseyConfig() {
    scan("com.devicehive.resource.converters",
            "com.devicehive.resource.exceptions",
            "com.devicehive.resource.filter");

    registerClasses(ApiInfoResourceImpl.class,
            ConfigurationResourceImpl.class,
            DeviceCommandResourceImpl.class,
            DeviceNotificationResourceImpl.class,
            DeviceResourceImpl.class,
            NetworkResourceImpl.class,
            DeviceTypeResourceImpl.class,
            WelcomeResourceImpl.class,
            UserResourceImpl.class);

    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

    register(RequestContextFilter.class);
    register(LoggingFeature.class);
    register(ContentTypeFilter.class);

    register(io.swagger.jaxrs.listing.ApiListingResource.class);
    register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
}
 
Example #4
Source File: JerseyConfig.java    From devicehive-java-server with Apache License 2.0 6 votes vote down vote up
public JerseyConfig() {
    scan("com.devicehive.resource.converters",
            "com.devicehive.resource.exceptions",
            "com.devicehive.resource.filter");

    registerClasses(PluginApiInfoResourceImpl.class,
            PluginResourceImpl.class);

    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

    register(RequestContextFilter.class);
    register(LoggingFeature.class);
    register(ContentTypeFilter.class);

    register(io.swagger.jaxrs.listing.ApiListingResource.class);
    register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
}
 
Example #5
Source File: JerseyConfig.java    From Auth-service with MIT License 5 votes vote down vote up
public JerseyConfig() {
    register(RequestContextFilter.class);
    register(ClientSecretResource.class);
    //配置restful package.
    register(SecurityResource.class);
    register(UserRoleResource.class);
}
 
Example #6
Source File: RequestHandler.java    From jrestless-examples with Apache License 2.0 5 votes vote down vote up
public RequestHandler() {
	// configure the application with the resource
	ResourceConfig resourceConfig = new ResourceConfig()
			.register(GatewayFeature.class)
			.register(RequestContextFilter.class)
			.packages("com.jrestless.aws.examples");
	resourceConfig.property("contextConfig", new AnnotationConfigApplicationContext(SpringConfig.class));
	init(resourceConfig);
	start();
}
 
Example #7
Source File: JerseyConfig.java    From spring-security-jwt with MIT License 5 votes vote down vote up
public JerseyConfig() {
    // Enable Spring and Jackson support
    register(RequestContextFilter.class);
    register(JacksonObjectMapperConfig.class);

    // Application resources
    register(GreetingsResource.class);
}
 
Example #8
Source File: MyDemoApplication.java    From demo-restWS-spring-jersey-jpa2-hibernate with MIT License 5 votes vote down vote up
/**
* Register JAX-RS application components.
*/	
public MyDemoApplication(){
	register(RequestContextFilter.class);
	register(PodcastRestService.class);
	register(PodcastLegacyRestService.class);
	register(JacksonFeature.class);	
	register(LoggingResponseFilter.class);
	register(CORSResponseFilter.class);
}
 
Example #9
Source File: MyDemoApplication.java    From demo-restWS-spring-jersey-tomcat-mybatis with MIT License 5 votes vote down vote up
/**
* Register JAX-RS application components.
*/	
public MyDemoApplication(){
	register(RequestContextFilter.class);
	register(PodcastRestService.class);
	register(JacksonFeature.class);		
	register(LoggingResponseFilter.class);
	register(CORSResponseFilter.class);
}
 
Example #10
Source File: ApplicationConfig.java    From gazpachoquest with GNU General Public License v3.0 5 votes vote down vote up
public ApplicationConfig() {
    register(RequestContextFilter.class);
    register(RolesAllowedDynamicFeature.class);
    register(Jackson2Feature.class);

    register(AuthorizationRequestFilter.class);
    register(QuestionnairResource.class);
    register(LoggingFilter.class);

    // register(JerseyResource.class);
    // register(SpringSingletonResource.class);
    // register(SpringRequestResource.class);
    // register(CustomExceptionMapper.class);

}
 
Example #11
Source File: MyDemoApplication.java    From demo-restWS-spring-jersey-tomcat-mybatis with MIT License 5 votes vote down vote up
/**
* Register JAX-RS application components.
*/	
public MyDemoApplication(){
	register(RequestContextFilter.class);
	register(PodcastRestService.class);
	register(JacksonFeature.class);		
	register(LoggingResponseFilter.class);
	register(CORSResponseFilter.class);
}
 
Example #12
Source File: JerseyConfig.java    From Qualitis with Apache License 2.0 4 votes vote down vote up
public JerseyConfig() {
    register(RequestContextFilter.class);
    register(MultiPartFeature.class);
    packages(RESOURCE_PACKAGE_NAME);
    property(ServletProperties.FILTER_FORWARD_ON_404, true);
}
 
Example #13
Source File: MyApplication.java    From Test-Driven-Java-Development-Second-Edition with MIT License 4 votes vote down vote up
public MyApplication(BooksEndpoint booksEndpoint) {
    register(booksEndpoint);
    register(RequestContextFilter.class);
    register(JacksonJaxbJsonProvider.class);
    register(CustomExceptionMapper.class);
}