org.mortbay.jetty.servlet.Context.getServletContext()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(217)

本文整理了Java中org.mortbay.jetty.servlet.Context.getServletContext()方法的一些代码示例,展示了Context.getServletContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getServletContext()方法的具体详情如下:
包路径:org.mortbay.jetty.servlet.Context
类名称:Context
方法名:getServletContext

Context.getServletContext介绍

暂无

代码示例

代码示例来源:origin: ch.cern.hadoop/hadoop-common

private void setContextAttributes(Context context, Configuration conf) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

private void setContextAttributes(Context context, Configuration conf) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: io.hops/hadoop-common

private void setContextAttributes(Context context, Configuration conf) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: io.hops/hadoop-common

private void setContextAttributes(Context context, Configuration conf) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

private void setContextAttributes(Context context, Configuration conf) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: io.hops/hadoop-common

private void setContextAttributes(Context context, Configuration conf) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

private void setContextAttributes(Context context, Configuration conf) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: io.fabric8/fabric-hadoop

private void setContextAttributes(Context context) {
 context.getServletContext().setAttribute(CONF_CONTEXT_ATTRIBUTE, conf);
 context.getServletContext().setAttribute(ADMINS_ACL, adminsAcl);
}

代码示例来源:origin: inspectIT/inspectIT

/**
 * Performs initialization of the web context binding it to Jetty.
 *
 * @throws Exception
 *             in case of an error while starting the Jetty context
 */
@PostConstruct
public void postConstruct() throws Exception {
  ServletContext servletContext = jettyContext.getServletContext();
  GenericWebApplicationContext webCtx = new GenericWebApplicationContext();
  webCtx.setServletContext(servletContext);
  webCtx.setParent(ctx);
  webCtx.refresh();
  servletContext.setAttribute(contextAttribute, webCtx);
  jettyContext.start();
  if (log.isInfoEnabled()) {
    log.info("| Jetty Web Application Context started!");
  }
}

代码示例来源:origin: com.googlecode.struts2-conversation/struts2-junit4-plugin

protected void initServer() throws Exception {
  LOG.info("Initializing Jetty server...");
  ServletHolder sh = new ServletHolder(ServletContainer.class);
  sh.setInitParameter(ServletContainer.RESOURCE_CONFIG_CLASS, PackagesResourceConfig.class.getName());
  sh.setInitParameter(PackagesResourceConfig.PROPERTY_PACKAGES, getPackages());
  sh.setServlet(new SpringServlet());
  server = new Server(getPort());
  Context context = new Context(server, getBasePath(), Context.SESSIONS);
  Map<String, String> params = new HashMap<String, String>();
  params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation());
  context.setInitParams(params);
  context.addEventListener(new ContextLoaderListener());
  context.addEventListener(new RequestContextListener());
  context.addServlet(sh, getServletMapping());
  server.start();
  LOG.info("Jetty server running.");
  this.applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext());
}

代码示例来源:origin: com.googlecode.struts2-conversation/struts2-junit4-plugin

protected void initServer() throws Exception {
  LOG.info("Initializing Jetty server...");
  ServletHolder sh = new ServletHolder(ServletContainer.class);
  sh.setInitParameter(ServletContainer.RESOURCE_CONFIG_CLASS, PackagesResourceConfig.class.getName());
  sh.setInitParameter(PackagesResourceConfig.PROPERTY_PACKAGES, getPackages());
  sh.setServlet(new SpringServlet());
  server = new Server(getPort());
  Context context = new Context(server, getBasePath(), Context.SESSIONS);
  Map<String, String> params = new HashMap<String, String>();
  params.put(ContextLoaderListener.CONFIG_LOCATION_PARAM, getSpringContextLocation());
  context.setInitParams(params);
  context.addEventListener(new ContextLoaderListener());
  context.addEventListener(new RequestContextListener());
  context.addServlet(sh, getServletMapping());
  server.start();
  LOG.info("Jetty server running.");
  applicationContext = WebApplicationContextUtils.getWebApplicationContext(context.getServletContext());
}

代码示例来源:origin: stapler/stapler

@Override
protected void setUp() throws Exception {
  super.setUp();
  server = new Server();
  server.setHandler(new WebAppContext("/noroot", ""));
  final Context context = new Context(server, getContextPath(), Context.SESSIONS);
  configure(context);
  server.setHandler(context);
  SocketConnector connector = new SocketConnector();
  server.addConnector(connector);
  server.start();
  url = new URL("http://localhost:"+connector.getLocalPort()+getContextPath()+"/");
  servletContext = context.getServletContext();
  webApp = WebApp.get(servletContext);
  // export the test object as the root as a reasonable default.
  webApp.setApp(this);
}

代码示例来源:origin: net.jahhan/dubbo-remoting-http

Node.getInstance().addServletContext(url.getPort(), context.getServletContext());

代码示例来源:origin: remoting/dubbox

ServletManager.getInstance().addServletContext(url.getPort(), context.getServletContext());

代码示例来源:origin: remoting/dubbox

ServletManager.getInstance().addServletContext(url.getPort(), context.getServletContext());

代码示例来源:origin: com.alibaba/dubbo-remoting-http

ServletManager.getInstance().addServletContext(url.getParameter(Constants.BIND_PORT_KEY, url.getPort()), context.getServletContext());

代码示例来源:origin: com.alibaba/dubbo

ServletManager.getInstance().addServletContext(url.getParameter(Constants.BIND_PORT_KEY, url.getPort()), context.getServletContext());

相关文章