本文整理汇总了Java中org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher类的典型用法代码示例。如果您正苦于以下问题:Java HttpServlet30Dispatcher类的具体用法?Java HttpServlet30Dispatcher怎么用?Java HttpServlet30Dispatcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HttpServlet30Dispatcher类属于org.jboss.resteasy.plugins.server.servlet包,在下文中一共展示了HttpServlet30Dispatcher类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: keycloakJaxRsApplication
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
@Bean
ServletRegistrationBean keycloakJaxRsApplication(KeycloakServerProperties keycloakServerProperties, DataSource dataSource) throws Exception {
mockJndiEnvironment(dataSource);
//FIXME: hack to propagate Spring Boot Properties to Keycloak Application
EmbeddedKeycloakApplication.keycloakServerProperties = keycloakServerProperties;
ServletRegistrationBean servlet = new ServletRegistrationBean(new HttpServlet30Dispatcher());
servlet.addInitParameter("javax.ws.rs.Application", EmbeddedKeycloakApplication.class.getName());
servlet.addInitParameter(ResteasyContextParameters.RESTEASY_SERVLET_MAPPING_PREFIX, keycloakServerProperties.getContextPath());
servlet.addInitParameter(ResteasyContextParameters.RESTEASY_USE_CONTAINER_FORM_PARAMS, "true");
servlet.addUrlMappings(keycloakServerProperties.getContextPath() + "/*");
servlet.setLoadOnStartup(1);
servlet.setAsyncSupported(true);
return servlet;
}
开发者ID:thomasdarimont,项目名称:spring-boot-keycloak-server-example,代码行数:19,代码来源:EmbeddedKeycloakConfig.java
示例2: undertowDeployment
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
static DeploymentInfo undertowDeployment(ResteasyDeployment deployment, String mapping) {
if (mapping == null) {
mapping = "/";
}
if (!mapping.startsWith("/")) {
mapping = '/' + mapping;
}
if (!mapping.endsWith("/")) {
mapping = mapping + '/';
}
mapping = mapping + '*';
String prefix = null;
if (!mapping.equals("/*")) {
prefix = mapping.substring(0, mapping.length() - 2);
}
ServletInfo resteasyServlet = Servlets.servlet("ResteasyServlet", HttpServlet30Dispatcher.class).setAsyncSupported(true).setLoadOnStartup(1).addMapping(mapping);
if (prefix != null) {
resteasyServlet.addInitParam("resteasy.servlet.mapping.prefix", prefix);
}
return (new DeploymentInfo()).addServletContextAttribute(ResteasyDeployment.class.getName(), deployment).addServlet(resteasyServlet);
}
示例3: setUp
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
/**
* Sets up the test environment, generates data to upload, starts an
* Undertow instance which will receive the client requests.
* @throws ServletException If an error occurred with the servlets
*/
@Before
public void setUp() throws ServletException {
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.getActualResourceClasses().addAll(Arrays.asList(AsyncUploadController.class, ReaderUploadController.class));
deployment.getActualProviderClasses().addAll(Arrays.asList(UploadReader.class, PartSizeMapper.class, RequestSizeMapper.class));
ServletInfo restEasyServlet = Servlets.servlet("RestEasyServlet", HttpServlet30Dispatcher.class)
.setAsyncSupported(true)
.setLoadOnStartup(1)
.addMapping("/*");
DeploymentInfo deploymentInfo = new DeploymentInfo()
.setContextPath("ROOT")
.addServletContextAttribute(ResteasyDeployment.class.getName(), deployment)
.addServlet(restEasyServlet).setDeploymentName("RestEasyUndertow")
.setClassLoader(ClassLoader.getSystemClassLoader());
DeploymentManager deploymentManager = Servlets.defaultContainer().addDeployment(deploymentInfo);
deploymentManager.deploy();
PathHandler path = Handlers.path(Handlers.redirect("/")).addPrefixPath("/", deploymentManager.start());
server = Undertow.builder()
.addHttpListener(8110, "localhost")
.setHandler(path)
.build();
server.start();
}
示例4: init
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
@PostConstruct
public void init() {
logger.info("Starting undertow w/ resteasy support.");
WebServlet resteasyServlet = new WebServletLiteral("RestEasy",new String[]{"/"},
new WebInitParam[]{},true,1);
Map<String,Object> servletContextParams = new HashMap<>();
servletContextParams.put(ResteasyDeployment.class.getName(), createDeployment());
undertowComponent = new UndertowComponent(httpListenPort,httpListenAddress,contextRoot,deploymentName)
.addServlet(resteasyServlet,HttpServlet30Dispatcher.class)
.setWebSocketEndpoint(CourseServer.class)
.addListener(RequestScopedServletRequestListener.class)
.start(servletContextParams);
logger.info("Container up and running on port "+httpListenPort);
}
示例5: startUndertow
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
public void startUndertow(@Observes ApplicationStartupEvent applicationStartupEvent) {
WebServlet resteasyServlet = new WebServletLiteral("RestEasy",new String[]{"/"},
new WebInitParam[]{},true,1);
Map<String,Object> servletContextParams = new HashMap<>();
servletContextParams.put(ResteasyDeployment.class.getName(), createDeployment());
undertowComponent = new UndertowComponent(undertowBindPort,undertowBindAddress,contextRoot,deploymentName)
.addServlet(resteasyServlet,HttpServlet30Dispatcher.class)
.addListener(RequestScopedServletRequestListener.class)
.start(servletContextParams);
}
示例6: resteasyServlet
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
@Produces
public ServletDescriptor resteasyServlet() {
String path = restServerConfiguration.getRestServerUri();
if( !(applicationInstance.isUnsatisfied() || applicationInstance.isAmbiguous())) {
ApplicationPath appPath = ClassUtils.getAnnotation(applicationInstance.get().getClass(), ApplicationPath.class);
if(appPath != null) {
path = appPath.value();
}
}
String pattern = path.endsWith("/") ? path + "*" : path + "/*";
WebInitParam param = new WebParam("resteasy.servlet.mapping.prefix", path);
return new ServletDescriptor("ResteasyServlet",new String[]{pattern}, new String[]{pattern},
1,new WebInitParam[]{param},true,HttpServlet30Dispatcher.class);
}
示例7: start
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
public void start() {
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.getActualResourceClasses().addAll(restMonitorExtension.getRestEndpointClasses());
deployment.getActualProviderClasses().addAll(restMonitorExtension.getProviderClasses());
deployment.setInjectorFactoryClass(CdiInjectorFactory.class.getName());
ListenerInfo listener = Servlets.listener(CDIListener.class);
ServletInfo resteasyServlet = Servlets.servlet("ResteasyServlet", HttpServlet30Dispatcher.class)
.setAsyncSupported(true)
.setLoadOnStartup(1)
.addMapping("/*");
DeploymentInfo di = new DeploymentInfo()
.addListener(listener)
.setContextPath(configurationManager.getContextRoot())
.addServletContextAttribute(ResteasyDeployment.class.getName(), deployment)
.addServlet(resteasyServlet).setDeploymentName("ResteasyUndertow")
.setClassLoader(ClassLoader.getSystemClassLoader());
DeploymentManager deploymentManager = Servlets.defaultContainer().addDeployment(di);
deploymentManager.deploy();
Undertow server = null;
try {
server = Undertow.builder()
.addHttpListener(configurationManager.getPort(), configurationManager.getBindAddress())
.setHandler(deploymentManager.start())
.build();
} catch (ServletException e) {
catchEvent.fire(new ExceptionToCatchEvent(e));
}
server.start();
this.undertow = server;
}
示例8: configureServlets
import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher; //导入依赖的package包/类
@Override
protected void configureServlets() {
bind(HttpServlet30Dispatcher.class).in(Singleton.class);
serve("/api/*").with(HttpServlet30Dispatcher.class);
bind(GuiceFilterDispatcher.class).in(Singleton.class);
filter("/api/*").through(GuiceFilterDispatcher.class);
}