Codota Logo
IWebContext.getResponse
Code IndexAdd Codota to your IDE (free)

How to use
getResponse
method
in
org.thymeleaf.context.IWebContext

Best Java code snippets using org.thymeleaf.context.IWebContext.getResponse (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: thymeleaf/thymeleaf

/**
 * <p>
 *   Process an already-built URL just before returning it.
 * </p>
 * <p>
 *   By default, this method will apply the {@code HttpServletResponse.encodeURL(url)} mechanism, as standard
 *   when using the Java Servlet API. Note however that this will only be applied if {@code context} is
 *   an implementation of {@code IWebContext} (i.e. the Servlet API will only be applied in web environments).
 * </p>
 * <p>
 *   This method can be overridden by any subclasses that want to change this behaviour (e.g. in order to
 *   avoid using the Servlet API).
 * </p>
 *
 * @param context the execution context.
 * @param link the already-built URL.
 * @return the processed URL, ready to be used.
 */
protected String processLink(final IExpressionContext context, final String link) {
  if (!(context instanceof IWebContext)) {
    return link;
  }
  final HttpServletResponse response = ((IWebContext)context).getResponse();
  return (response != null? response.encodeURL(link) : link);
}
origin: thymeleaf/thymeleaf

return ((IWebContext) context).getResponse();
origin: thymeleaf/thymeleaf

  return new WebEngineContext(
      configuration, templateData, templateResolutionAttributes,
      webContext.getRequest(), webContext.getResponse(), webContext.getServletContext(),
      webContext.getLocale(), Collections.EMPTY_MAP);
return new WebEngineContext(
    configuration, templateData, templateResolutionAttributes,
    webContext.getRequest(), webContext.getResponse(), webContext.getServletContext(),
    webContext.getLocale(), variables);
origin: thymeleaf/thymeleaf-extras-springsecurity

@Override
public HttpServletResponse getHttpServletResponse(final IContext context) {
  if (context instanceof IWebContext) {
    return ((IWebContext)context).getResponse();
  }
  throw new TemplateProcessingException(
      "Cannot obtain HttpServletResponse from a non-WebFlux context implementation (\"" +
      context.getClass().getName() + "\")");
}
origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity5

@Override
public HttpServletResponse getHttpServletResponse(final IContext context) {
  if (context instanceof IWebContext) {
    return ((IWebContext)context).getResponse();
  }
  throw new TemplateProcessingException(
      "Cannot obtain HttpServletResponse from a non-WebFlux context implementation (\"" +
      context.getClass().getName() + "\")");
}
origin: thymeleaf/thymeleaf-extras-springsecurity

@Override
protected boolean isVisible(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return false;
  }
  if (!(context instanceof IWebContext)) {
    throw new ConfigurationException(
        "Thymeleaf execution context is not a web context (implementation of " +
        IWebContext.class.getName() + "). Spring Security integration can only be used in " +
        "web environments.");
  }
  final IWebContext webContext = (IWebContext) context;
  final HttpServletRequest request = webContext.getRequest();
  final HttpServletResponse response = webContext.getResponse();
  final ServletContext servletContext = webContext.getServletContext();
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  if (authentication == null) {
    return false;
  }
  return AuthUtils.authorizeUsingAccessExpression(
      context, attrValue, authentication, request, response, servletContext);
}

origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity4

@Override
protected boolean isVisible(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return false;
  }
  if (!(context instanceof IWebContext)) {
    throw new ConfigurationException(
        "Thymeleaf execution context is not a web context (implementation of " +
        IWebContext.class.getName() + "). Spring Security integration can only be used in " +
        "web environments.");
  }
  final IWebContext webContext = (IWebContext) context;
  final HttpServletRequest request = webContext.getRequest();
  final HttpServletResponse response = webContext.getResponse();
  final ServletContext servletContext = webContext.getServletContext();
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  if (authentication == null) {
    return false;
  }
  return AuthUtils.authorizeUsingAccessExpression(
      context, attrValue, authentication, request, response, servletContext);
}

origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity3

@Override
protected boolean isVisible(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return false;
  }
  if (!(context instanceof IWebContext)) {
    throw new ConfigurationException(
        "Thymeleaf execution context is not a web context (implementation of " +
        IWebContext.class.getName() + "). Spring Security integration can only be used in " +
        "web environments.");
  }
  final IWebContext webContext = (IWebContext) context;
  
  final HttpServletRequest request = webContext.getRequest();
  final HttpServletResponse response = webContext.getResponse();
  final ServletContext servletContext = webContext.getServletContext();
  
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  if (authentication == null) {
    return false;
  }
  
  return AuthUtils.authorizeUsingAccessExpression(
      context, attrValue, authentication, request, response, servletContext);
  
}

origin: thymeleaf/thymeleaf-extras-springsecurity

@Override
protected boolean isVisible(
    final ITemplateContext context, final IProcessableElementTag tag,
    final AttributeName attributeName, final String attributeValue) {
  final String attrValue = (attributeValue == null? null : attributeValue.trim());
  if (attrValue == null || attrValue.length() == 0) {
    return false;
  }
  if (!(context instanceof IWebContext)) {
    throw new ConfigurationException(
        "Thymeleaf execution context is not a web context (implementation of " +
        IWebContext.class.getName() + "). Spring Security integration can only be used in " +
        "web environments.");
  }
  final IWebContext webContext = (IWebContext) context;
  
  final HttpServletRequest request = webContext.getRequest();
  final HttpServletResponse response = webContext.getResponse();
  final ServletContext servletContext = webContext.getServletContext();
  
  final Authentication authentication = AuthUtils.getAuthenticationObject();
  if (authentication == null) {
    return false;
  }
  
  return AuthUtils.authorizeUsingAccessExpression(
      context, attrValue, authentication, request, response, servletContext);
  
}

origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity3

public Object buildObject(final IExpressionContext context, final String expressionObjectName) {
  if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      return AuthUtils.getAuthenticationObject();
    }
  }
  if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      // We retrieve it like this in order to give it the opportunity to come from cache
      final Authentication authentication =
          (Authentication) context.getExpressionObjects().getObject(AUTHENTICATION_EXPRESSION_OBJECT_NAME);
      final IWebContext webContext = (IWebContext)context;
      final HttpServletRequest request = webContext.getRequest();
      final HttpServletResponse response = webContext.getResponse();
      final ServletContext servletContext = webContext.getServletContext();
      return new Authorization(context, authentication, request, response, servletContext);
    }
    return null;
  }
  return null;
}
origin: thymeleaf/thymeleaf-extras-springsecurity

public Object buildObject(final IExpressionContext context, final String expressionObjectName) {
  if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      return AuthUtils.getAuthenticationObject();
    }
  }
  if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      // We retrieve it like this in order to give it the opportunity to come from cache
      final Authentication authentication =
          (Authentication) context.getExpressionObjects().getObject(AUTHENTICATION_EXPRESSION_OBJECT_NAME);
      final IWebContext webContext = (IWebContext)context;
      final HttpServletRequest request = webContext.getRequest();
      final HttpServletResponse response = webContext.getResponse();
      final ServletContext servletContext = webContext.getServletContext();
      return new Authorization(context, authentication, request, response, servletContext);
    }
    return null;
  }
  return null;
}
origin: thymeleaf/thymeleaf-extras-springsecurity

public Object buildObject(final IExpressionContext context, final String expressionObjectName) {
  if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      return AuthUtils.getAuthenticationObject();
    }
  }
  if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      // We retrieve it like this in order to give it the opportunity to come from cache
      final Authentication authentication =
          (Authentication) context.getExpressionObjects().getObject(AUTHENTICATION_EXPRESSION_OBJECT_NAME);
      final IWebContext webContext = (IWebContext)context;
      final HttpServletRequest request = webContext.getRequest();
      final HttpServletResponse response = webContext.getResponse();
      final ServletContext servletContext = webContext.getServletContext();
      return new Authorization(context, authentication, request, response, servletContext);
    }
    return null;
  }
  return null;
}
origin: org.thymeleaf.extras/thymeleaf-extras-springsecurity4

public Object buildObject(final IExpressionContext context, final String expressionObjectName) {
  if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      return AuthUtils.getAuthenticationObject();
    }
  }
  if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) {
    if (context instanceof IWebContext) {
      // We retrieve it like this in order to give it the opportunity to come from cache
      final Authentication authentication =
          (Authentication) context.getExpressionObjects().getObject(AUTHENTICATION_EXPRESSION_OBJECT_NAME);
      final IWebContext webContext = (IWebContext)context;
      final HttpServletRequest request = webContext.getRequest();
      final HttpServletResponse response = webContext.getResponse();
      final ServletContext servletContext = webContext.getServletContext();
      return new Authorization(context, authentication, request, response, servletContext);
    }
    return null;
  }
  return null;
}
org.thymeleaf.contextIWebContextgetResponse

Javadoc

Returns the HttpServletResponse object associated with the template execution.

Popular methods of IWebContext

  • getRequest
  • getHttpServletRequest
    Returns the HttpServletRequest object associated with the request this context has been created for
  • getServletContext
    Returns the ServletContext object associated with the web application.
  • getHttpServletResponse
    Returns the HttpServletResponse object associated with the request this context has been created fo
  • getHttpSession
    Returns the HttpSession object associated with the request this context has been created for.
  • getLocale
  • getSession
    Returns the HttpSession object associated with the template execution, or null if there is no sessi

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now