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


Java ContainerInitializer类代码示例

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


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

示例1: newWebAppContext

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
static WebAppContext newWebAppContext() throws MalformedURLException {
    final WebAppContext handler = new WebAppContext();
    handler.setContextPath("/");
    handler.setBaseResource(Resource.newResource(webAppRoot()));
    handler.setClassLoader(new URLClassLoader(
            new URL[] {
                    Resource.newResource(new File(webAppRoot(),
                                                  "WEB-INF" + File.separatorChar +
                                                  "lib" + File.separatorChar +
                                                  "hello.jar")).getURI().toURL()
            },
            JettyService.class.getClassLoader()));

    handler.addBean(new ServletContainerInitializersStarter(handler), true);
    handler.setAttribute(
            "org.eclipse.jetty.containerInitializers",
            Collections.singletonList(new ContainerInitializer(new JettyJasperInitializer(), null)));
    return handler;
}
 
开发者ID:line,项目名称:armeria,代码行数:20,代码来源:JettyServiceTest.java

示例2: createCrossDomainHandler

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
/**
 * Creates a Jetty context handler that can be used to expose the cross-domain functionality as implemented by
 * {@link FlashCrossDomainServlet}.
 *
 * Note that an invocation of this method will not register the handler (and thus make the related functionality
 * available to the end user). Instead, the created handler is returned by this method, and will need to be
 * registered with the embedded Jetty webserver by the caller.
 *
 * @return A Jetty context handler (never null).
 */
protected Handler createCrossDomainHandler()
{
    final ServletContextHandler context = new ServletContextHandler( null, "/crossdomain.xml", ServletContextHandler.SESSIONS );

    // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add( new ContainerInitializer( new JasperInitializer(), null ) );
    context.setAttribute( "org.eclipse.jetty.containerInitializers", initializers );
    context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager() );

    // Generic configuration of the context.
    context.setAllowNullPathInfo( true );

    // Add the functionality-providers.
    context.addServlet( new ServletHolder( new FlashCrossDomainServlet() ), "" );

    return context;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:29,代码来源:HttpBindManager.java

示例3: initializePlugin

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
@Override
public void initializePlugin( PluginManager manager, File pluginDirectory )
{
    for ( final String publicResource : publicResources )
    {
        AuthCheckFilter.addExclude( publicResource );
    }

    // Add the Webchat sources to the same context as the one that's providing the BOSH interface.
    context = new WebAppContext( null, pluginDirectory.getPath() + File.separator + "classes/", "/inverse" );
    context.setClassLoader( this.getClass().getClassLoader() );

    // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add( new ContainerInitializer( new JettyJasperInitializer(), null ) );
    context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
    context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager());

    HttpBindManager.getInstance().addJettyHandler( context );
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:InversePlugin.java

示例4: initializePlugin

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
@Override
public void initializePlugin( PluginManager manager, File pluginDirectory )
{
    for ( final String publicResource : publicResources )
    {
        AuthCheckFilter.addExclude( publicResource );
    }

    // Add the Webchat sources to the same context as the one that's providing the BOSH interface.
    context = new WebAppContext( null, pluginDirectory.getPath() + File.separator + "classes", "/candy" );
    context.setClassLoader( this.getClass().getClassLoader() );

    // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add( new ContainerInitializer( new JettyJasperInitializer(), null ) );
    context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
    context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager());

    HttpBindManager.getInstance().addJettyHandler( context );
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:CandyPlugin.java

示例5: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
private static List<ContainerInitializer> jspInitializers() {
    JettyJasperInitializer sci = new JettyJasperInitializer();
    ContainerInitializer initializer = new ContainerInitializer(sci, null);
    List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add(initializer);
    return initializers;
}
 
开发者ID:stevespringett,项目名称:Alpine,代码行数:8,代码来源:EmbeddedJettyServer.java

示例6: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
/**
 * Initializer to activate JSP support in Jetty.
 *
 * @return list of initializer to support jsp compiling
 */
private static List<ContainerInitializer> jspInitializers() {

    final JettyJasperInitializer sci = new JettyJasperInitializer();
    final ContainerInitializer initializer = new ContainerInitializer(sci, null);
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add(initializer);
    return initializers;
}
 
开发者ID:gmuecke,项目名称:boutique-de-jus,代码行数:14,代码来源:BoutiqueDeJusWebServer.java

示例7: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
private static List<ContainerInitializer> jspInitializers() {
	JettyJasperInitializer sci = new JettyJasperInitializer();
	ContainerInitializer initializer = new ContainerInitializer(sci, null);
	List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>();
	initializers.add(initializer);
	return initializers;
}
 
开发者ID:gustavohbf,项目名称:robotoy,代码行数:8,代码来源:WebServer.java

示例8: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
private List<ContainerInitializer> jspInitializers() {
    JasperInitializer sci = new JasperInitializer();
    ContainerInitializer initializer = new ContainerInitializer(sci, null);
    List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>();
    initializers.add(initializer);
    return initializers;
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:8,代码来源:JettyLauncher.java

示例9: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
private List<ContainerInitializer> jspInitializers() {
    JettyJasperInitializer sci = new JettyJasperInitializer();
    ContainerInitializer initializer = new ContainerInitializer(sci, null);
    List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add(initializer);
    return initializers;
}
 
开发者ID:aspectran,项目名称:aspectran,代码行数:8,代码来源:JettyWebAppContext.java

示例10: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
/**
 * Ensure the jsp engine is initialized correctly
 */
private List<ContainerInitializer> jspInitializers() {
	JettyJasperInitializer sci = new JettyJasperInitializer();
	ContainerInitializer initializer = new ContainerInitializer(sci, null);
	List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>();
	initializers.add(initializer);
	return initializers;
}
 
开发者ID:logsniffer,项目名称:logsniffer,代码行数:11,代码来源:JettyLauncher.java

示例11: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
private List<ContainerInitializer> jspInitializers() {
	JettyJasperInitializer sci = new JettyJasperInitializer();
	ContainerInitializer initializer = new ContainerInitializer(
			(ServletContainerInitializer) sci, null);
	List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>();
	initializers.add(initializer);
	return initializers;
}
 
开发者ID:yahoo,项目名称:mysql_perf_analyzer,代码行数:9,代码来源:App.java

示例12: createBoshHandler

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
/**
 * Creates a Jetty context handler that can be used to expose BOSH (HTTP-Bind) functionality.
 *
 * Note that an invocation of this method will not register the handler (and thus make the related functionality
 * available to the end user). Instead, the created handler is returned by this method, and will need to be
 * registered with the embedded Jetty webserver by the caller.
 *
 * @return A Jetty context handler (never null).
 */
protected Handler createBoshHandler()
{
    final ServletContextHandler context = new ServletContextHandler( null, "/http-bind", ServletContextHandler.SESSIONS );

    // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add( new ContainerInitializer( new JasperInitializer(), null ) );
    context.setAttribute( "org.eclipse.jetty.containerInitializers", initializers );
    context.setAttribute( InstanceManager.class.getName(), new SimpleInstanceManager() );

    // Generic configuration of the context.
    context.setAllowNullPathInfo( true );

    // Add the functionality-providers.
    context.addServlet( new ServletHolder( new HttpBindServlet() ), "/*" );

    // Add compression filter when needed.
    if ( isHttpCompressionEnabled() )
    {
        final Filter gzipFilter = new AsyncGzipFilter()
        {
            @Override
            public void init( FilterConfig config ) throws ServletException
            {
                super.init( config );
                _methods.add( HttpMethod.POST.asString() );
                Log.info( "Installed response compression filter" );
            }
        };

        final FilterHolder filterHolder = new FilterHolder();
        filterHolder.setFilter( gzipFilter );
        context.addFilter( filterHolder, "/*", EnumSet.of( DispatcherType.REQUEST ) );
    }

    return context;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:47,代码来源:HttpBindManager.java

示例13: createWebAppContext

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
private void createWebAppContext() {
    WebAppContext context;
    // Add web-app. Check to see if we're in development mode. If so, we don't
    // add the normal web-app location, but the web-app in the project directory.
    boolean developmentMode = Boolean.getBoolean("developmentMode");
    if( developmentMode )
    {
        System.out.println(LocaleUtils.getLocalizedString("admin.console.devmode"));

        context = new WebAppContext(contexts, pluginDir.getParentFile().getParentFile().getParentFile().getParent() +
                File.separator + "src" + File.separator + "web", "/");
    }
    else {
        context = new WebAppContext(contexts, pluginDir.getAbsoluteFile() + File.separator + "webapp",
                "/");
    }

    // Ensure the JSP engine is initialized correctly (in order to be able to cope with Tomcat/Jasper precompiled JSPs).
    final List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add(new ContainerInitializer(new JasperInitializer(), null));
    context.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
    context.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());

    // The index.html includes a redirect to the index.jsp and doesn't bypass
    // the context security when in development mode
    context.setWelcomeFiles(new String[]{"index.html"});

    // Make sure the context initialization is done when in development mode
    if( developmentMode )
    {
        context.addBean( new ServletContainerInitializersStarter( context ), true );
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:34,代码来源:AdminConsolePlugin.java

示例14: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
/**
 * Ensure the jsp engine is initialized correctly
 */
private List<ContainerInitializer> jspInitializers()
{
    JettyJasperInitializer sci = new JettyJasperInitializer();
    ContainerInitializer initializer = new ContainerInitializer(sci, null);
    List<ContainerInitializer> initializers = new ArrayList<ContainerInitializer>();
    initializers.add(initializer);
    return initializers;
}
 
开发者ID:sgsinclair,项目名称:VoyantServer,代码行数:12,代码来源:JettyRunTime.java

示例15: jspInitializers

import org.eclipse.jetty.plus.annotation.ContainerInitializer; //导入依赖的package包/类
/**
 * Ensure the JSP engine is initialized correctly
 */
private List<ContainerInitializer> jspInitializers() {
    List<ContainerInitializer> initializers = new ArrayList<>();
    initializers.add(new ContainerInitializer(new JettyJasperInitializer(), null));
    return initializers;
}
 
开发者ID:RWTH-i5-IDSG,项目名称:steve-plugsurfing,代码行数:9,代码来源:SteveAppContext.java


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