Examples of RequestAttributes


Examples of org.springframework.web.context.request.RequestAttributes

    // Expose current LocaleResolver and request as LocaleContext.
    LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
    LocaleContextHolder.setLocaleContext(buildLocaleContext(request), this.threadContextInheritable);

    // Expose current RequestAttributes to current thread.
    RequestAttributes previousRequestAttributes = RequestContextHolder.getRequestAttributes();
    ServletRequestAttributes requestAttributes = new ServletRequestAttributes(request);
    RequestContextHolder.setRequestAttributes(requestAttributes, this.threadContextInheritable);

    if (logger.isDebugEnabled()) {
      logger.debug("Bound request context to thread: " + request);
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    // Expose current LocaleResolver and request as LocaleContext.
    LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
    LocaleContextHolder.setLocaleContext(buildLocaleContext(request), this.threadContextInheritable);

    // Expose current RequestAttributes to current thread.
    RequestAttributes previousRequestAttributes = RequestContextHolder.getRequestAttributes();
    PortletRequestAttributes requestAttributes = new PortletRequestAttributes(request);
    RequestContextHolder.setRequestAttributes(requestAttributes, this.threadContextInheritable);

    if (logger.isDebugEnabled()) {
      logger.debug("Bound action request context to thread: " + request);
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    // Expose current LocaleResolver and request as LocaleContext.
    LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
    LocaleContextHolder.setLocaleContext(buildLocaleContext(request), this.threadContextInheritable);

    // Expose current RequestAttributes to current thread.
    RequestAttributes previousRequestAttributes = RequestContextHolder.getRequestAttributes();
    PortletRequestAttributes requestAttributes = new PortletRequestAttributes(request);
    RequestContextHolder.setRequestAttributes(requestAttributes, this.threadContextInheritable);

    if (logger.isDebugEnabled()) {
      logger.debug("Bound render request context to thread: " + request);
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    try {
      LocaleContextHolder.setLocale(httpRequest.getLocale());
      RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(httpRequest));

      LocaleContext servletLocaleContext = LocaleContextHolder.getLocaleContext();
      RequestAttributes servletRequestAttrs = RequestContextHolder.getRequestAttributes();

      MockActionRequest request = new MockActionRequest();
      MockActionResponse response = new MockActionResponse();
      request.setParameter("action", "form");
      request.setParameter("age", "29");
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    try {
      LocaleContextHolder.setLocale(httpRequest.getLocale());
      RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(httpRequest));

      LocaleContext servletLocaleContext = LocaleContextHolder.getLocaleContext();
      RequestAttributes servletRequestAttrs = RequestContextHolder.getRequestAttributes();

      MockRenderRequest request = new MockRenderRequest();
      MockRenderResponse response = new MockRenderResponse();
      request.setParameter("action", "form");
      request.setParameter("age", "29");
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    try {
      LocaleContextHolder.setLocale(httpRequest.getLocale());
      RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(httpRequest));

      LocaleContext servletLocaleContext = LocaleContextHolder.getLocaleContext();
      RequestAttributes servletRequestAttrs = RequestContextHolder.getRequestAttributes();

      MockActionRequest request = new MockActionRequest();
      MockActionResponse response = new MockActionResponse();
      request.setParameter("action", "invalid");
      simpleDispatcherPortlet.processAction(request, response);
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    try {
      LocaleContextHolder.setLocale(httpRequest.getLocale());
      RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(httpRequest));

      LocaleContext servletLocaleContext = LocaleContextHolder.getLocaleContext();
      RequestAttributes servletRequestAttrs = RequestContextHolder.getRequestAttributes();

      MockRenderRequest request = new MockRenderRequest();
      MockRenderResponse response = new MockRenderResponse();
      try {
        simpleDispatcherPortlet.doDispatch(request, response);
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    // Expose current LocaleResolver and request as LocaleContext.
    LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
    LocaleContextHolder.setLocaleContext(buildLocaleContext(request), this.threadContextInheritable);

    // Expose current RequestAttributes to current thread.
    RequestAttributes previousRequestAttributes = RequestContextHolder.getRequestAttributes();
    PortletRequestAttributes requestAttributes = new PortletRequestAttributes(request);
    RequestContextHolder.setRequestAttributes(requestAttributes, this.threadContextInheritable);

    if (logger.isDebugEnabled()) {
      logger.debug("Bound action request context to thread: " + request);
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    // Expose current LocaleResolver and request as LocaleContext.
    LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
    LocaleContextHolder.setLocaleContext(buildLocaleContext(request), this.threadContextInheritable);

    // Expose current RequestAttributes to current thread.
    RequestAttributes previousRequestAttributes = RequestContextHolder.getRequestAttributes();
    PortletRequestAttributes requestAttributes = new PortletRequestAttributes(request);
    RequestContextHolder.setRequestAttributes(requestAttributes, this.threadContextInheritable);

    if (logger.isDebugEnabled()) {
      logger.debug("Bound render request context to thread: " + request);
View Full Code Here

Examples of org.springframework.web.context.request.RequestAttributes

    beanFactory.registerScope(WebApplicationContext.SCOPE_SESSION, new SessionScope(false));
    beanFactory.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, new SessionScope(true));

    beanFactory.registerResolvableDependency(PortletRequest.class, new ObjectFactory() {
      public Object getObject() {
        RequestAttributes requestAttr = RequestContextHolder.currentRequestAttributes();
        if (!(requestAttr instanceof PortletRequestAttributes)) {
          throw new IllegalStateException("Current request is not a portlet request");
        }
        return ((PortletRequestAttributes) requestAttr).getRequest();
      }
    });
    beanFactory.registerResolvableDependency(PortletSession.class, new ObjectFactory() {
      public Object getObject() {
        RequestAttributes requestAttr = RequestContextHolder.currentRequestAttributes();
        if (!(requestAttr instanceof PortletRequestAttributes)) {
          throw new IllegalStateException("Current request is not a portlet request");
        }
        return ((PortletRequestAttributes) requestAttr).getRequest().getPortletSession();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.