Tabnine Logo
WebContext.getWrappedWebContext
Code IndexAdd Tabnine to your IDE (free)

How to use
getWrappedWebContext
method
in
org.tinygroup.weblayer.WebContext

Best Java code snippets using org.tinygroup.weblayer.WebContext.getWrappedWebContext (Showing top 10 results out of 315)

origin: org.tinygroup/weblayer

/**
 * 在指定的request context及其级联的request context中找到一个指定类型的request context。
 *
 * @param webContext          要搜索的request context
 * @param webContextInterface 要查找的类
 * @return <code>WebContext</code>对象,如果没找到,则返回<code>null</code>
 */
public static <R extends WebContext> R findWebContext(WebContext webContext, Class<R> webContextInterface) {
  do {
    if (webContextInterface.isInstance(webContext)) {
      break;
    }
    webContext = webContext.getWrappedWebContext();
  } while (webContext != null);
  return webContextInterface.cast(webContext);
}
origin: org.tinygroup/org.tinygroup.weblayerbase

/**
 * 在指定的request context及其级联的request context中找到一个指定类型的request context。
 *
 * @param webContext          要搜索的request context
 * @param webContextInterface 要查找的类
 * @return <code>WebContext</code>对象,如果没找到,则返回<code>null</code>
 */
public static <R extends WebContext> R findWebContext(WebContext webContext, Class<R> webContextInterface) {
  do {
    if (webContextInterface.isInstance(webContext)) {
      break;
    }
    webContext = webContext.getWrappedWebContext();
  } while (webContext != null);
  return webContextInterface.cast(webContext);
}
origin: org.tinygroup/org.tinygroup.weblayerbase

protected <T> T getFromWrapperContext(String name, WebContext webContext) {
  T result = getFromSubContext(name, webContext);
  if (result != null) {
    return result;
  }
  if (webContext.getWrappedWebContext() != null) {
    result = getFromWrapperContext(name,
        webContext.getWrappedWebContext());
    if (result != null) {
      return result;
    }
  }
  return null;
}
origin: org.tinygroup/org.tinygroup.weblayerbase

protected boolean existFromWrapperContext(String name, WebContext webContext) {
  boolean exist = existFromSubContext(name, webContext);
  if (exist) {
    return true;
  }
  if (webContext.getWrappedWebContext() != null) {
    exist = existFromWrapperContext(name,
        webContext.getWrappedWebContext());
    if (exist) {
      return true;
    }
  }
  return false;
}
origin: org.tinygroup/org.tinygroup.weblayer

/**
 * 判断请求是否已经结束。如果请求被重定向了,则表示请求已经结束。
 *
 * @param webContext
 * @return
 */
private boolean isRequestFinished(int filterSize, WebContext webContext) {
  WebContext wrapContext = webContext;
  for (int i = 0; i < filterSize; i++) {
    if (wrapContext != null) {
      if (wrapContext.isRequestFinished()) {
        return true;
      }
      wrapContext = wrapContext.getWrappedWebContext();
    }
  }
  return false;
}
origin: org.tinygroup/weblayer

protected <T> T getFromWrapperContext(String name, WebContext webContext) {
  T result = (T) getFromSubContext(name, webContext);
  if (!ObjectUtil.isEmptyObject(result))
    return result;
  if (webContext.getWrappedWebContext() != null) {
    result = (T) getFromWrapperContext(name, webContext.getWrappedWebContext());
    if (!ObjectUtil.isEmptyObject(result)) {
      return result;
    }
  }
  return null;
}
origin: org.tinygroup/org.tinygroup.weblayer

/**
 * 头部提交,保证内容只提交一次
 *
 * @param wrapperedContext
 */
public void commitHeaders(WebContext wrapperedContext) {
  CommitMonitor monitor = getCommitMonitor(wrapperedContext);
  synchronized (monitor) {
    if (!monitor.isHeadersCommitted()) {
      monitor.setHeadersCommitted(true);
      for (WebContext rc = wrapperedContext; rc != null; rc = rc
          .getWrappedWebContext()) {
        if (rc instanceof TwoPhaseCommitWebContext) {
          TwoPhaseCommitWebContext tpc = (TwoPhaseCommitWebContext) rc;
          logger.logMessage(LogLevel.TRACE,
              "Committing headers: {}", tpc.getClass()
                  .getSimpleName());
          tpc.commitHeaders();
        }
      }
    }
  }
}
origin: org.tinygroup/weblayer

/**
 * 
 * 头部提交,保证内容只提交一次
 * 
 * @param wrapperedContext
 */
public void commitHeaders(WebContext wrapperedContext) {
  CommitMonitor monitor = getCommitMonitor(wrapperedContext);
  synchronized (monitor) {
    if (!monitor.isHeadersCommitted()) {
      monitor.setHeadersCommitted(true);
      for (WebContext rc = wrapperedContext; rc != null; rc = rc
          .getWrappedWebContext()) {
        if (rc instanceof TwoPhaseCommitWebContext) {
          TwoPhaseCommitWebContext tpc = (TwoPhaseCommitWebContext) rc;
          logger.logMessage(LogLevel.TRACE,
              "Committing headers: {}", tpc.getClass()
                  .getSimpleName());
          tpc.commitHeaders();
        }
      }
    }
  }
}
origin: org.tinygroup/weblayer

wrapperedContext = wrapperedContext.getWrappedWebContext();
origin: org.tinygroup/org.tinygroup.weblayer

wrapperedContext = wrapperedContext.getWrappedWebContext();
org.tinygroup.weblayerWebContextgetWrappedWebContext

Javadoc

获取包装过的WebContext

Popular methods of WebContext

  • getRequest
    返回请求上下文关联的http请求对象
  • getResponse
    返回请求上下文中关联的http响应对象
  • get
  • put
  • getServletContext
    取得servletContext对象
  • init
    初始化web上下文方法
  • putSubContext
  • setRequest
    设置请求上下文中关联的http请求对象
  • setResponse
    设置请求上下文中关联的http响应对象
  • exist
  • isRequestFinished
    请求是否已终止,例如请求已被重定向了,该请求将被终止,返回true。还有访问的页面已被缓存,可以直接从缓存中获取页面信息,也将返回true, 默认实现是返回false。
  • isRequestFinished

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setRequestProperty (URLConnection)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now