Package org.springframework.context.i18n

Examples of org.springframework.context.i18n.LocaleContext


   * @param request current HTTP request
   * @return the corresponding LocaleContext
   */
  @Override
  protected LocaleContext buildLocaleContext(final HttpServletRequest request) {
    return new LocaleContext() {
      public Locale getLocale() {
        return localeResolver.resolveLocale(request);
      }
      @Override
      public String toString() {
View Full Code Here


    long startTime = System.currentTimeMillis();
    Throwable failureCause = null;

    // 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 = null;
View Full Code Here

  public ModelAndView handleRequest(final HttpServletRequest request, HttpServletResponse response) throws Exception {

    final LocaleResolver localeResolver = (LocaleResolver)request.getAttribute(LOCALE_RESOLVER_ATTRIBUTE);

        // Expose current LocaleResolver and request as LocaleContext.
        LocaleContext previousLocaleContext = LocaleContextHolder.getLocaleContext();
       
        if ( previousLocaleContext.getLocale() == null ) {
          LocaleContextHolder.setLocaleContext(new LocaleContext() {
              public Locale getLocale() {

                  return localeResolver.resolveLocale(request);
              }
          });
View Full Code Here

TOP

Related Classes of org.springframework.context.i18n.LocaleContext

Copyright © 2018 www.massapicom. 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.