本文整理汇总了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();
}
示例2: addCustomConfiguration
import org.mortbay.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
@Override
protected void addCustomConfiguration(ServletHolder holder)
{
holder.put(LISTENER_NAME, "com.gs.jrpip.FakeListener");
}
示例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();
}
示例4: addCustomConfiguration
import org.mortbay.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
@Override
protected void addCustomConfiguration(ServletHolder holder)
{
holder.put("methodInterceptor", TestMethodInterceptor.class.getName());
}