當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。