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


Java ServletHolder.put方法代码示例

本文整理汇总了Java中org.mortbay.jetty.servlet.ServletHolder.put方法的典型用法代码示例。如果您正苦于以下问题:Java ServletHolder.put方法的具体用法?Java ServletHolder.put怎么用?Java ServletHolder.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mortbay.jetty.servlet.ServletHolder的用法示例。


在下文中一共展示了ServletHolder.put方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupServer

import org.mortbay.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
private void setupServer() throws Exception
{
    this.server = new HttpServer();
    SocketListener listener = new SocketListener();
    listener.setPort(PORT);
    this.server.addListener(listener);
    HttpContext context = new HttpContext();
    context.setContextPath("/");

    ServletHandler servletHandler = new ServletHandler();
    context.addHandler(servletHandler);

    // Map a servlet onto the container
    ServletHolder holder =
            servletHandler.addServlet("JrpipServlet", "/JrpipServlet", "com.gs.jrpip.server.JrpipServlet");
    holder.put("serviceInterface.Echo", "com.gs.jrpip.Echo");
    holder.put("vmBoundServiceClass.Echo", "com.gs.jrpip.EchoImpl");
    holder.setInitOrder(10);

    this.server.addContext(context);

    this.server.start();
    this.servlet = (JrpipServlet) holder.getServlet();
}
 
开发者ID:goldmansachs,项目名称:jrpip,代码行数:25,代码来源:VmBoundServiceTest.java

示例2: addCustomConfiguration

import org.mortbay.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
@Override
protected void addCustomConfiguration(ServletHolder holder)
{
    holder.put(LISTENER_NAME, "com.gs.jrpip.FakeListener");
}
 
开发者ID:goldmansachs,项目名称:jrpip,代码行数:6,代码来源:JrpipListenerTest.java

示例3: setupServerWithHandler

import org.mortbay.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
protected void setupServerWithHandler(
        HttpHandler handler,
        SecurityConstraint constraint,
        UserRealm realm) throws Exception
{
    this.port = (int) (Math.random() * 10000.0 + 10000.0);
    this.jrpipUrl = "http://localhost:" + this.port + "/JrpipServlet";
    this.server = new HttpServer();
    SocketListener listener = new SocketListener();
    listener.setPort(this.port);
    this.server.addListener(listener);
    HttpContext context = new HttpContext();
    context.setContextPath("/");

    if (realm != null)
    {
        context.setRealm(realm);
    }

    if (constraint != null)
    {
        context.addSecurityConstraint("/", constraint);
    }

    if (handler != null)
    {
        context.addHandler(handler);
    }

    ServletHandler servletHandler = new ServletHandler();
    context.addHandler(servletHandler);

    ServletHolder holder = servletHandler.addServlet("JrpipServlet", "/JrpipServlet", "com.gs.jrpip.server.JrpipServlet");
    holder.put("serviceInterface.Echo", "com.gs.jrpip.Echo");
    holder.put("serviceClass.Echo", "com.gs.jrpip.EchoImpl");

    this.addCustomConfiguration(holder);

    holder.setInitOrder(10);

    this.server.addContext(context);
    this.server.start();
    this.servlet = (JrpipServlet) holder.getServlet();
}
 
开发者ID:goldmansachs,项目名称:jrpip,代码行数:45,代码来源:JrpipTestCase.java

示例4: addCustomConfiguration

import org.mortbay.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
@Override
protected void addCustomConfiguration(ServletHolder holder)
{
    holder.put("methodInterceptor", TestMethodInterceptor.class.getName());
}
 
开发者ID:goldmansachs,项目名称:jrpip,代码行数:6,代码来源:MethodInterceptorTest.java


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