本文整理汇总了Java中org.eclipse.jetty.servlet.ServletHolder.setInitParameters方法的典型用法代码示例。如果您正苦于以下问题:Java ServletHolder.setInitParameters方法的具体用法?Java ServletHolder.setInitParameters怎么用?Java ServletHolder.setInitParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jetty.servlet.ServletHolder
的用法示例。
在下文中一共展示了ServletHolder.setInitParameters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addServlet
import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
public void addServlet(String path, Class<? extends Servlet> servlet, Map<String, String> initParameters) {
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath(path);
ServletHolder holder = new ServletHolder(servlet);
holder.setInitParameters(initParameters);
context.addServlet(holder, path);
handlers.add(context);
}
示例2: addJspServlet
import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
/**
* Add Jetty's {@code JspServlet} to the given {@link WebAppContext}.
* @param context the jetty {@link WebAppContext}
*/
protected final void addJspServlet(WebAppContext context) {
Assert.notNull(context, "Context must not be null");
ServletHolder holder = new ServletHolder();
holder.setName("jsp");
holder.setClassName(getJspServlet().getClassName());
holder.setInitParameter("fork", "false");
holder.setInitParameters(getJspServlet().getInitParameters());
holder.setInitOrder(3);
context.getServletHandler().addServlet(holder);
ServletMapping mapping = new ServletMapping();
mapping.setServletName("jsp");
mapping.setPathSpecs(new String[] { "*.jsp", "*.jspx" });
context.getServletHandler().addServletMapping(mapping);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:JettyEmbeddedServletContainerFactory.java
示例3: addServlet
import org.eclipse.jetty.servlet.ServletHolder; //导入方法依赖的package包/类
/**
* Add a servlet to the servlet registry. This servlet will be attached to the
* specified URL pattern when the server is started up.
*
* @param urlPattern the URL pattern for paths. Eg, '/foo', '/foo/*'.
* @param servlet the servlet class to bind to the specified paths.
* @param initParams the map with init params, can be null or empty.
* @return the {@link ServletHolder} that holds the servlet.
*/
public ServletHolder addServlet(String urlPattern, Class<? extends HttpServlet> servlet,
@Nullable Map<String, String> initParams) {
ServletHolder servletHolder = new ServletHolder(servlet);
if (initParams != null) {
servletHolder.setInitParameters(initParams);
}
servletRegistry.add(new Pair<>(urlPattern, servletHolder));
return servletHolder;
}