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

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

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

origin: org.tinygroup/org.tinygroup.weblayerbase

/**
 * 将<code>WebContext</code>对象和request相关联。
 *
 * @param WebContext <code>WebContext</code>对象
 */
public static void setWebContext(WebContext WebContext) {
  HttpServletRequest request = WebContext.getRequest();
  request.setAttribute(REQUEST_CONTEXT_KEY, WebContext);
}
origin: org.tinygroup/org.tinygroup.weblayer

private WebContext getWebContext(WebContext context,
                 List<TinyFilter> tinyFilters, HttpServletRequest request,
                 HttpServletResponse response) throws ServletException, IOException {
  WebContext webContext = WebContextUtil.getWebContext(context
      .getRequest());
  if (webContext == null) {
    webContext = createWrapperContext(context, tinyFilters, request,
        response);
    context.getRequest().setAttribute(WEB_CONTEXT_OWNER_KEY, this);
  }
  return webContext;
}
origin: org.tinygroup/weblayer

private WebContext getWebContext(WebContext context,
    List<TinyFilter> tinyFilters, HttpServletRequest request,
    HttpServletResponse response) {
  WebContext webContext = WebContextUtil.getWebContext(context
      .getRequest());
  if (webContext == null) {
    webContext = createWrapperContext(context, tinyFilters, request,
        response);
    context.getRequest().setAttribute(WEB_CONTEXT_OWNER_KEY, this);
  }
  return webContext;
}
origin: org.tinygroup/org.tinygroup.weblayerbase

public void reallyProcess(String urlString, WebContext context)
    throws ServletException, IOException {
  HttpServletRequest request = context.getRequest();
  HttpServletResponse response = context.getResponse();
  servlet.service(request, response);
}
origin: org.tinygroup/org.tinygroup.pageflowbasiccomponent

public void execute(Context context) {
  Assert.assertNotNull(sessionKey, "sessionKey must not null");
  WebContext webContext = (WebContext) context;
  webContext.getRequest().getSession(true).removeAttribute(sessionKey);
}
origin: org.tinygroup/org.tinygroup.pageflowbasiccomponent

public void execute(Context context) {
  try {
    WebContext webContext = (WebContext) context;
    HttpServletRequest request = webContext.getRequest();
    request.getRequestDispatcher(path).forward(request,
        webContext.getResponse());
  } catch (Exception e) {
    logger.errorMessage("Forward到地址[{}]出错,错误原因:{}", e, path,
        e.getMessage());
  }
}
origin: org.tinygroup/weblayer

public void execute(Context context) {
  try {
    WebContext webContext = (WebContext) context;
    HttpServletRequest request = webContext.getRequest();
    request.getRequestDispatcher(path).forward(request,
        webContext.getResponse());
  } catch (Exception e) {
    logger.errorMessage("Forward到地址[{}]出错,错误原因:{}", e, path,
        e.getMessage());
  }
}
origin: org.tinygroup/org.tinygroup.weblayerbase

/**
 * 包装一个<code>RequestContext</code>对象。
 *
 * @param wrappedContext
 *            被包装的<code>RequestContext</code>
 */
public ParserWebContextImpl(WebContext wrappedContext) {
  super(wrappedContext);
  setRequest(new RequestWrapper(wrappedContext.getRequest()));
}
origin: org.tinygroup/weblayer

public void reallyProcess(String urlString, WebContext context) {
  HttpServletRequest request = context.getRequest();
  HttpServletResponse response = context.getResponse();
  try {
    servlet.service(request, response);
  } catch (Exception e) {
    logger.errorMessage("servlet:{}执行出错", e, servlet.getServletName());
    throw new RuntimeException("servlet执行出错", e);
  }
}
origin: org.tinygroup/weblayer

/**
 * 包装一个<code>RequestContext</code>对象。
 *
 * @param wrappedContext 被包装的<code>RequestContext</code>
 */
public ParserWebContextImpl(WebContext wrappedContext) {
  super(wrappedContext);
  setRequest(new RequestWrapper(wrappedContext.getRequest()));
}
origin: org.tinygroup/org.tinygroup.urlrestful

private String getHttpMethod(RewriteSubstitutionContext context) {
  WebContext webContext = context.getParserWebContext();
  String httpMethod = webContext.get(HTTP_METHOD_KEY);
  if (StringUtil.isBlank(httpMethod)) {
    httpMethod = webContext.getRequest().getMethod();
  }
  return httpMethod;
}
origin: org.tinygroup/org.tinygroup.weblayerbase

public AbstractWebContextWrapper(WebContext wrappedContext) {
  assertNotNull(wrappedContext, "wrappedContext");
  this.wrappedContext = wrappedContext;
  this.request = wrappedContext.getRequest();
  this.response = wrappedContext.getResponse();
  this.servletContext = wrappedContext.getServletContext();
}
origin: org.tinygroup/weblayer

public AbstractWebContextWrapper(WebContext wrappedContext) {
  assertNotNull(wrappedContext, "wrappedContext");
  this.wrappedContext = wrappedContext;
  this.request = wrappedContext.getRequest();
  this.response = wrappedContext.getResponse();
  this.servletContext = wrappedContext.getServletContext();
}
origin: org.tinygroup/org.tinygroup.pageflowbasiccomponent

public void execute(Context context) {
  Assert.assertNotNull(contextKey, "contextKey must not null");
  Assert.assertNotNull(sessionKey, "sessionKey must not null");
  Object object = context.get(contextKey);
  if (!ObjectUtil.isEmptyObject(object)) {
    WebContext webContext = (WebContext) context;
    logger.logMessage(LogLevel.INFO, "put object:[{}] to session,the key is [{}]", object, sessionKey);
    webContext.getRequest().getSession(true).setAttribute(sessionKey, object);
  } else {
    logger.logMessage(LogLevel.WARN, "not found object with key:[{}] from context", contextKey);
  }
}
origin: org.tinygroup/flowbasiccomponent

public void execute(Context context) {
  Assert.assertNotNull(contextKey, "contextKey must not null");
  Assert.assertNotNull(sessionKey, "sessionKey must not null");
  Object object=context.get(contextKey);
  if(!ObjectUtil.isEmptyObject(object)){
    WebContext webContext=(WebContext)context;
    logger.logMessage(LogLevel.INFO, "put object:[{}] to session,the key is [{}]",object,sessionKey);
    webContext.getRequest().getSession(true).setAttribute(sessionKey, object);
  }else{
    logger.logMessage(LogLevel.WARN, "not found object with key:[{}] from context",contextKey);
  }
  
  
}
origin: org.tinygroup/org.tinygroup.weblayerbase

public WebContext getAlreadyWrappedContext(WebContext wrappedContext) {
  SessionWebContext sessionWebContext= new SessionWebContextImpl(wrappedContext, config);
  String pattern = config.ignoreSessionCheckPattern();
  if(!StringUtil.isBlank(pattern)){
    String servletPath = WebContextUtil.getServletPath(wrappedContext.getRequest());
    if(Pattern.matches(pattern, servletPath)){
      sessionWebContext.setIgnoreSessionTimeoutCheck(true);
    }
  }
  return sessionWebContext;
}
origin: org.tinygroup/weblayer

/** 构造函数。 */
public SessionWebContextImpl(WebContext wrappedContext, SessionConfig sessionConfig) {
  super(wrappedContext);
  this.sessionConfig = sessionConfig;
  setRequest(new SessionRequestWrapper(wrappedContext.getRequest()));
  setResponse(new SessionResponseWrapper(wrappedContext.getResponse()));
}
origin: org.tinygroup/org.tinygroup.weblayerbase

/**
 * 构造函数。
 */
public SessionWebContextImpl(WebContext wrappedContext,
               SessionConfig sessionConfig) {
  super(wrappedContext);
  this.sessionConfig = sessionConfig;
  setRequest(new SessionRequestWrapper(wrappedContext.getRequest()));
  setResponse(new SessionResponseWrapper(wrappedContext.getResponse()));
}
origin: org.tinygroup/org.tinygroup.weblayerbase

/**
 * 包装一个<code>RequestContext</code>对象。
 *
 * @param wrappedContext 被包装的<code>RequestContext</code>
 */
public SetLocaleWebContextImpl(WebContext wrappedContext) {
  super(wrappedContext);
  setRequest(new RequestWrapper(wrappedContext.getRequest()));
  setResponse(new ResponseWrapper(wrappedContext.getResponse()));
}
origin: org.tinygroup/org.tinygroup.weblayerbase

public void filterWrapper(WebContext context, FilterHandler handler)
    throws IOException, ServletException {
  HttpServletRequest request = context.getRequest();
  HttpServletResponse response = context.getResponse();
  String servletPath = handler.getServletPath();
  List<Filter> matchFilters = getMatchFilters(servletPath, filterMap);
  logger.logMessage(LogLevel.DEBUG,
      "the pre wrapper httpFilters for the request path:[{0}] is [{1}]",
      servletPath, matchFilters);
  TinyFilterChain filterChain = new TinyFilterChain(matchFilters, handler);
  filterChain.doFilter(request, response);
}
org.tinygroup.weblayerWebContextgetRequest

Javadoc

返回请求上下文关联的http请求对象

Popular methods of WebContext

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

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Top Vim plugins
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