本文整理匯總了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());
}