Make ServletRegistrationBean and FilterRegistration bean generic
Closes gh-7666
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -45,10 +45,10 @@ public class SampleAtmosphereApplication {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ServletRegistrationBean atmosphereServlet() {
|
||||
public ServletRegistrationBean<AtmosphereServlet> atmosphereServlet() {
|
||||
// Dispatcher servlet is mapped to '/home' to allow the AtmosphereServlet
|
||||
// to be mapped to '/chat'
|
||||
ServletRegistrationBean registration = new ServletRegistrationBean(
|
||||
ServletRegistrationBean<AtmosphereServlet> registration = new ServletRegistrationBean<AtmosphereServlet>(
|
||||
new AtmosphereServlet(), "/chat/*");
|
||||
registration.addInitParameter("org.atmosphere.cpr.packages", "sample");
|
||||
registration.addInitParameter("org.atmosphere.interceptor.HeartbeatInterceptor"
|
||||
|
||||
@@ -46,8 +46,8 @@ public class SampleJersey1Application {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean jersey() {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
public FilterRegistrationBean<ServletContainer> jersey() {
|
||||
FilterRegistrationBean<ServletContainer> bean = new FilterRegistrationBean<ServletContainer>();
|
||||
bean.setFilter(new ServletContainer());
|
||||
bean.addInitParameter("com.sun.jersey.config.property.packages",
|
||||
"com.sun.jersey;sample.jersey1");
|
||||
|
||||
Reference in New Issue
Block a user