org.mortbay.jetty.webapp.WebAppContext.setAttribute()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(149)

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

WebAppContext.setAttribute介绍

暂无

代码示例

代码示例来源:origin: org.apache.tajo/tajo-core

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

代码示例来源:origin: org.apache.hama/hama-core

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * 
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

代码示例来源:origin: apache/tajo

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

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

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

代码示例来源:origin: apache/hama

/**
 * Set a value in the webapp context. These values are available to the jsp
 * pages as "application.getAttribute(name)".
 * 
 * @param name The name of the attribute
 * @param value The value of the attribute
 */
public void setAttribute(String name, Object value) {
 webAppContext.setAttribute(name, value);
}

代码示例来源:origin: org.apache.isis.runtimes.dflt/webserver

/**
 * Bound to the {@link WebAppContext} so that they can be used when
 * bootstrapping.
 * 
 * @param context
 */
@SuppressWarnings("unchecked")
private void copyConfigurationPrimersIntoServletContext(final WebAppContext context) {
  final List<IsisConfigurationBuilderPrimer> isisConfigurationBuilderPrimers = (List<IsisConfigurationBuilderPrimer>) (List<?>) runner.getOptionHandlers();
  context.setAttribute(WebAppConstants.CONFIGURATION_PRIMERS_KEY, isisConfigurationBuilderPrimers);
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

/** Set temporary directory for context.
 * The javax.servlet.context.tempdir attribute is also set.
 * @param dir Writable temporary directory.
 */
public void setTempDirectory(File dir)
{
  if (isStarted())
    throw new IllegalStateException("Started");
  if (dir!=null)
  {
    try{dir=new File(dir.getCanonicalPath());}
    catch (IOException e){Log.warn(Log.EXCEPTION,e);}
  }
  if (dir!=null && !dir.exists())
  {
    dir.mkdir();
    dir.deleteOnExit();
  }
  else if (dir != null)
    _isExistingTmpDir = true;
  if (dir!=null && ( !dir.exists() || !dir.isDirectory() || !dir.canWrite()))
    throw new IllegalArgumentException("Bad temp directory: "+dir);
  _tmpDir=dir;
  setAttribute(ServletHandler.__J_S_CONTEXT_TEMPDIR,_tmpDir);
}

代码示例来源:origin: org.springframework.osgi/org.springframework.osgi.web

/**
 * {@inheritDoc}
 * 
 * Creates an OSGi-specific Jetty war deployer.
 */
protected WarDeployment createDeployment(Bundle bundle, String contextPath) throws Exception {
  WebAppContext wac = createJettyWebContext(bundle, contextPath);
  // FIXME: remove this once things are improved in Jetty (OSGI-438)
  wac.setAttribute(WarDeploymentContext.OSGI_BUNDLE_CONTEXT_ATTRIBUTE, OsgiBundleUtils.getBundleContext(bundle));
  JettyWarDeployment deployment = new JettyWarDeployment(new JettyContextUndeployer() {
    public void undeploy(WebAppContext webAppCtx) throws OsgiWarDeploymentException {
      stopWebAppContext(webAppCtx);
    }
  }, bundle, wac);
  return deployment;
}

代码示例来源:origin: org.sonatype.plexus/plexus-jetty6

public WebAppContext getWebAppContext( Context context, ContextHandlerCollection parent )
    throws Exception
  {
    WebAppContext webapp = new WebAppContext( parent, getWarPath(), getContextPath() );

    // Put all our custom attribute into the servlet context

    if ( getContextAttributes() != null )
    {
      for ( Iterator<Object> i = getContextAttributes().keySet().iterator(); i.hasNext(); )
      {
        String attributeKey = (String) i.next();

        webapp.setAttribute( attributeKey, getContextAttributes().getProperty( attributeKey ) );
      }
    }

    // Put the container for the application into the servlet context

    PlexusContainer container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
    
    webapp.setAttribute( PlexusConstants.PLEXUS_KEY, container );

    webapp.setClassLoader( container.getContainerRealm() );

    return webapp;
  }
}

代码示例来源:origin: org.springframework.osgi/spring-osgi-web

/**
 * {@inheritDoc}
 * 
 * Creates an OSGi-specific Jetty war deployer.
 */
protected WarDeployment createDeployment(Bundle bundle, String contextPath) throws Exception {
  WebAppContext wac = createJettyWebContext(bundle, contextPath);
  // FIXME: remove this once things are improved in Jetty (OSGI-438)
  wac.setAttribute(WarDeploymentContext.OSGI_BUNDLE_CONTEXT_ATTRIBUTE, OsgiBundleUtils.getBundleContext(bundle));
  JettyWarDeployment deployment = new JettyWarDeployment(new JettyContextUndeployer() {
    public void undeploy(WebAppContext webAppCtx) throws OsgiWarDeploymentException {
      stopWebAppContext(webAppCtx);
    }
  }, bundle, wac);
  return deployment;
}

代码示例来源:origin: org.sonatype.plexus/plexus-jetty6

webAppContext.setAttribute( attributeKey, webapp.getContextAttributes().getProperty( attributeKey ) );
webAppContext.setAttribute( PlexusConstants.PLEXUS_KEY, container );

代码示例来源:origin: org.sonatype.plexus/plexus-jetty6

public void lifeCycleStarting( LifeCycle lifecycle )
{
  if ( lifecycle instanceof ContextHandlerCollection )
  {
    Logger logger = Log.getLogger( getClass().getName() );
    Handler[] childHandlers = ((ContextHandlerCollection) lifecycle).getChildHandlers();
    if ( childHandlers != null && childHandlers.length > 0 )
    {
      for ( Handler child : childHandlers )
      {
        if ( child instanceof WebAppContext )
        {
          WebAppContext webapp = (WebAppContext) child;
          if ( logger != null )
          {
            logger.info( "Injecting Plexus container for: {} (context path: {})", webapp.getDisplayName(),
                   webapp.getContextPath() );
          }
          PlexusContainer container = PlexusContainerHolder.get();
          webapp.setAttribute( PlexusConstants.PLEXUS_KEY, container );
          webapp.setClassLoader( container.getContainerRealm() );
        }
      }
    }
  }
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

protected void startContext()
  throws Exception
{
  // Configure defaults
  for (int i=0;i<_configurations.length;i++)
    _configurations[i].configureDefaults();
  
  // Is there a WEB-INF work directory
  Resource web_inf=getWebInf();
  if (web_inf!=null)
  {
    Resource work= web_inf.addPath("work");
    if (work.exists()
            && work.isDirectory()
            && work.getFile() != null
            && work.getFile().canWrite()
            && getAttribute(ServletHandler.__J_S_CONTEXT_TEMPDIR) == null)
      setAttribute(ServletHandler.__J_S_CONTEXT_TEMPDIR, work.getFile());
  }
  
  // Configure webapp
  for (int i=0;i<_configurations.length;i++)
    _configurations[i].configureWebApp();
  
  super.startContext();
}

相关文章

WebAppContext类方法