当前位置: 首页>>代码示例>>Java>>正文


Java CXFServlet类代码示例

本文整理汇总了Java中org.apache.cxf.transport.servlet.CXFServlet的典型用法代码示例。如果您正苦于以下问题:Java CXFServlet类的具体用法?Java CXFServlet怎么用?Java CXFServlet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CXFServlet类属于org.apache.cxf.transport.servlet包,在下文中一共展示了CXFServlet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initWebApp

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
private WebAppContext initWebApp() throws IOException {
    WebAppContext ctx = new WebAppContext();
    ctx.setContextPath(CONFIG.getContextPath());
    ctx.setResourceBase(new ClassPathResource("webapp").getURI().toString());

    // Disable directory listings if no index.html is found.
    ctx.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");

    ServletHolder web = new ServletHolder("spring-dispatcher", new DispatcherServlet(springContext));
    ServletHolder cxf = new ServletHolder("cxf", new CXFServlet());

    ctx.addEventListener(new ContextLoaderListener(springContext));
    ctx.addServlet(web, CONFIG.getSpringMapping());
    ctx.addServlet(cxf, CONFIG.getCxfMapping());

    if (CONFIG.getProfile().isProd()) {
        addSecurityFilter(ctx);
    }

    initJSP(ctx);
    return ctx;
}
 
开发者ID:RWTH-i5-IDSG,项目名称:steve-plugsurfing,代码行数:23,代码来源:SteveAppContext.java

示例2: onStartup

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
	WebApplicationContext context = getContext();
	servletContext.addListener(new ContextLoaderListener(context));
	servletContext.addFilter("characterEncodingFilter", new CharacterEncodingFilter("UTF-8"));

	DispatcherServlet dispatcherServlet = new DispatcherServlet(context);
	dispatcherServlet.setThrowExceptionIfNoHandlerFound(true);

	ServletRegistration.Dynamic dispatcher = servletContext.addServlet("Dispatcher", dispatcherServlet);
	dispatcher.setLoadOnStartup(1);
	dispatcher.addMapping("/*");

	CXFServlet cxf = new CXFServlet();
	BusFactory.setDefaultBus(cxf.getBus());
	ServletRegistration.Dynamic cxfServlet = servletContext.addServlet("CXFServlet", cxf);
	cxfServlet.setLoadOnStartup(1);
	cxfServlet.addMapping("/services/*");

	servletContext.addFilter("springSecurityFilterChain", new DelegatingFilterProxy("springSecurityFilterChain")).addMappingForUrlPatterns(null, false,
			"/*");

	servletContext.getSessionCookieConfig().setSecure(cookieSecure);
}
 
开发者ID:esig,项目名称:dss-demonstrations,代码行数:25,代码来源:AppInitializer.java

示例3: startPeopleService

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
public void startPeopleService() throws Exception {
    final File base = createBaseDirectory();
    log.info("Using base folder: " + base.getAbsolutePath());

    final Tomcat tomcat = new Tomcat();
    tomcat.setPort(8080);
    tomcat.setBaseDir(base.getAbsolutePath());

    Context context = tomcat.addContext("/", base.getAbsolutePath());
    Tomcat.addServlet(context, "CXFServlet", new CXFServlet());

    context.addServletMapping("/rest/*", "CXFServlet");
    context.addApplicationListener(ContextLoaderListener.class.getName());
    context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader()));

    context.addParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName());
    context.addParameter("contextConfigLocation", AppConfig.class.getName());

    tomcat.start();
    tomcat.getServer().await();
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:22,代码来源:Starter.java

示例4: main

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
public static void main(final String[] args) throws Exception {
    final File base = createBaseDirectory();
    log.info("Using base folder: " + base.getAbsolutePath());

    final Tomcat tomcat = new Tomcat();
    tomcat.setPort(8080);
    tomcat.setBaseDir( base.getAbsolutePath() );

    Context context = tomcat.addContext( "/", base.getAbsolutePath() );
    Tomcat.addServlet( context, "CXFServlet", new CXFServlet() );

    context.addServletMapping( "/rest/*", "CXFServlet" );
    context.addApplicationListener( ContextLoaderListener.class.getName() );
    context.setLoader( new WebappLoader( Thread.currentThread().getContextClassLoader() ) );

    context.addParameter( "contextClass", AnnotationConfigWebApplicationContext.class.getName() );
    context.addParameter( "contextConfigLocation", MusicConfig.class.getName() );

    tomcat.start();
    tomcat.getServer().await();
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:22,代码来源:Server.java

示例5: startJaxRsServer

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
public void startJaxRsServer() throws LifecycleException, IOException {
    final File base = createBaseDirectory(basedir);
    log.info("Using base folder: " + base.getAbsolutePath());
    tomcat = new Tomcat();
    tomcat.setPort(tomcatPort);
    tomcat.setBaseDir(base.getAbsolutePath());
    Context context = tomcat.addContext("/", base.getAbsolutePath());
    Tomcat.addServlet(context, "CXFServlet", new CXFServlet());
    context.addServletMapping("/rest/*", "CXFServlet");
    context.addApplicationListener(ContextLoaderListener.class.getName());
    context.setLoader(new WebappLoader(Thread.currentThread().getContextClassLoader()));
    context.addParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName());
    context.addParameter("contextConfigLocation", tomcatClass);
    tomcat.start();
    tomcat.getServer().await();
}
 
开发者ID:wso2,项目名称:carbon-platform-integration,代码行数:17,代码来源:TomcatServerManager.java

示例6: cxfServlet

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
@Bean
public ServletRegistrationBean cxfServlet() {
    final ServletRegistrationBean bean = new ServletRegistrationBean();
    bean.setEnabled(true);
    bean.setName("cxfServletSecurityTokenService");
    bean.setServlet(new CXFServlet());
    bean.setUrlMappings(Collections.singleton(WSFederationConstants.ENDPOINT_STS.concat("*")));
    bean.setAsyncSupported(true);
    return bean;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:11,代码来源:CoreWsSecuritySecurityTokenServiceConfiguration.java

示例7: servletRegistrationBean

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
@Bean
public ServletRegistrationBean servletRegistrationBean() {

  CXFServlet cxfServlet = new CXFServlet();
  ServletRegistrationBean servletRegistration = new ServletRegistrationBean(cxfServlet, URL_PATH_SERVICES + "/*");
  return servletRegistration;
}
 
开发者ID:oasp,项目名称:oasp-tutorial-sources,代码行数:8,代码来源:ServiceConfig.java

示例8: cxfServlet

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
@Bean
public ServletRegistrationBean cxfServlet() {
	LOGGER.info("Initializing CXF");

	ServletRegistrationBean servletDef = new ServletRegistrationBean(new CXFServlet(), "/api/soap/*");
	servletDef.setLoadOnStartup(1);
	return servletDef;
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:9,代码来源:CxfInitializer.java

示例9: soapServletRegistrationBean

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
@Bean
public ServletRegistrationBean soapServletRegistrationBean() {
    log.info("+++  soapServletRegistration");
    ServletRegistrationBean registration = new ServletRegistrationBean(new CXFServlet(), "/services/*");
    registration.setLoadOnStartup(1);
    registration.setName("CXFServlet");
    return registration;
}
 
开发者ID:przodownikR1,项目名称:cxf_over_jms_kata,代码行数:9,代码来源:CxfConfig.java

示例10: cxfServlet

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
@Bean
public ServletRegistrationBean cxfServlet() {
    ServletRegistrationBean registration = new ServletRegistrationBean();
    registration.setServlet(new CXFServlet());
    registration.addInitParameter("service-list-path", "midpointservices");
    registration.setLoadOnStartup(1);
    registration.addUrlMappings("/model/*", "/ws/*");

    return registration;
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:11,代码来源:MidPointSpringApplication.java

示例11: addApacheCxfServlet

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
private void addApacheCxfServlet(ServletContext servletContext) {
  CXFServlet cxfServlet = new CXFServlet();

  ServletRegistration.Dynamic appServlet = servletContext.addServlet("CXFServlet", cxfServlet);
  appServlet.setLoadOnStartup(1);

  Set<String> mappingConflicts = appServlet.addMapping("/api/v1/*");
}
 
开发者ID:basileus-v,项目名称:rest-api-template,代码行数:9,代码来源:SpringWebAppInitializer.java

示例12: createCXFServlet

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
private void createCXFServlet(ServletContext servletContext) {
        log.info("Creating CXF Servlet started....");

        CXFServlet servlet = new CXFServlet();

        ServletRegistration.Dynamic appServlet = servletContext.addServlet("CXFServlet", servlet);
        appServlet.setLoadOnStartup(1);
        appServlet.addMapping("/services/*");

        // for serving up asynchronous events in tomcat
        appServlet.setAsyncSupported(true);

//        log.info("Creating CXF Servlet completed");
    }
 
开发者ID:bjornharvold,项目名称:bearchoke,代码行数:15,代码来源:FrontendWebApplicationInitializer.java

示例13: startServer

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
@Before
public void startServer()
    throws Exception
{

    System.setProperty( "redback.admin.creation.file", "target/auto-admin-creation.properties" );

    server = new Server();
    serverConnector = new ServerConnector( server, new HttpConnectionFactory() );
    server.addConnector( serverConnector );

    ServletHolder servletHolder = new ServletHolder( new CXFServlet() );
    ServletContextHandler context = new ServletContextHandler( ServletContextHandler.SESSIONS );
    context.setResourceBase( SystemUtils.JAVA_IO_TMPDIR );
    context.setSessionHandler( new SessionHandler() );
    context.addServlet( servletHolder, "/" + getRestServicesPath() + "/*" );
    context.setInitParameter( "contextConfigLocation", getSpringConfigLocation() );
    context.addEventListener( new ContextLoaderListener() );

    ServletHolder servletHolderRepo = new ServletHolder( new RepositoryServlet() );
    context.addServlet( servletHolderRepo, "/repository/*" );

    server.setHandler( context );
    server.start();
    port = serverConnector.getLocalPort();
    log.info( "start server on port {}", this.port );

    User user = new User();
    user.setEmail( "[email protected]" );
    user.setFullName( "the root user" );
    user.setUsername( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME );
    user.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD );

    getUserService( null ).createAdminUser( user );


}
 
开发者ID:apache,项目名称:archiva,代码行数:38,代码来源:AbstractDownloadTest.java

示例14: configStandaloneServer

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
private CXFServlet configStandaloneServer() {
    httpServer = new org.eclipse.jetty.server.Server(httpPort);
    Bus bus = BusFactory.getDefaultBus(true);
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    httpServer.setHandler(contexts);
    ServletContextHandler root = new ServletContextHandler(contexts, "/",
            ServletContextHandler.SESSIONS);
    CXFServlet cxf = new CXFServlet();
    cxf.setBus(bus);
    ServletHolder servlet = new ServletHolder(cxf);
    root.addServlet(servlet, "/cxf/*");
    return cxf;
}
 
开发者ID:ow2-chameleon,项目名称:fuchsia,代码行数:14,代码来源:ProtobufferExporter.java

示例15: addSpringContext

import org.apache.cxf.transport.servlet.CXFServlet; //导入依赖的package包/类
static private void addSpringContext(HandlerCollection collection) {
  final ServletHolder servletHolder = new ServletHolder(new CXFServlet());
  final ServletContextHandler context = new ServletContextHandler();
  context.setContextPath("/");

  context.addServlet(servletHolder, "/rest/*");
  context.addEventListener(new ContextLoaderListener());

  context.setInitParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName());
  context.setInitParameter("contextConfigLocation", AppConfig.class.getName());

  collection.addHandler(context);
}
 
开发者ID:raphaeljolivet,项目名称:java2typescript,代码行数:14,代码来源:Starter.java


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