org.apache.tiles.core.locale.impl

## Class DefaultLocaleResolver

- java.lang.Object
- - org.apache.tiles.core.locale.impl.DefaultLocaleResolver

- All Implemented Interfaces:
    LocaleResolver

      public class DefaultLocaleResolver
      extends Object
      implements LocaleResolver

  Default implementation of `LocaleResolver`
  It tries to take the locale from the session-scoped attribute `LOCALE_KEY`. If it is not found, it returns the locale included in the request.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `LOCALE_KEY` The attribute name that is used to store the current locale.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultLocaleResolver()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Locale` | `resolveLocale(Request request)` Resolves the locale.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### LOCALE_KEY

          public static final String LOCALE_KEY

      The attribute name that is used to store the current locale.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DefaultLocaleResolver

          public DefaultLocaleResolver()

  - ### Method Detail

    - #### resolveLocale

          public Locale resolveLocale(Request request)

      Resolves the locale.
      Specified by:
        `resolveLocale` in interface `LocaleResolver`
      Parameters:
        `request` - The Tiles request object.
      Returns:
        The current locale for the current request.

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.