• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HttpServlet30Dispatcher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
}
 
开发者ID:automenta,项目名称:spimedb,代码行数:27,代码来源:WebServer.java


示例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();
}
 
开发者ID:Elopteryx,项目名称:upload-parser,代码行数:35,代码来源:UploadReaderTest.java


示例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);
}
 
开发者ID:johnament,项目名称:restful-and-beyond-tut2184,代码行数:15,代码来源:Listener.java


示例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);
}
 
开发者ID:johnament,项目名称:restful-and-beyond-tut2184,代码行数:11,代码来源:SecureServer.java


示例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);
}
 
开发者ID:hammock-project,项目名称:hammock,代码行数:15,代码来源:ResteasyServletContextAttributeProvider.java


示例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;
}
 
开发者ID:johnament,项目名称:microservices-tutorial,代码行数:35,代码来源:WebServerLauncher.java


示例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);

}
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:11,代码来源:MentorServletModule.java



注:本文中的org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VcsRoot类代码示例发布时间:2022-05-22
下一篇:
Java StandardCrosshairLabelGenerator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap