Class I18nTextProvider

java.lang.Object
org.nuiton.i18n.web.I18nTextProvider
All Implemented Interfaces:
com.opensymphony.xwork2.TextProvider

public class I18nTextProvider extends Object implements com.opensymphony.xwork2.TextProvider
Struts2's TextProvider implementation using nuiton's i18n. To use this text provider add the two following lines in your struts.xml :
     <bean class="org.nuiton.i18n.web.I18nTextProvider" name="i18nTextProvider" type="com.opensymphony.xwork2.TextProvider" />
     <constant name="struts.textProvider" value="i18nTextProvider" />
 
Before struts 2.5, you may use "struts.xworkTextProvider" instead of StrutsConstants.STRUTS_TEXT_PROVIDER
Since:
3.7
Author:
Arnaud Thimel<thimel@codelutin.com>
  • Field Details

  • Constructor Details

    • I18nTextProvider

      public I18nTextProvider()
  • Method Details

    • getSafeText

      protected String getSafeText(String key, String value)
    • hasKey

      public boolean hasKey(String key)
      Specified by:
      hasKey in interface com.opensymphony.xwork2.TextProvider
    • getLocale

      protected Locale getLocale()
      Implementation copied from DefaultTextProvider.getText(String)
    • getTextFromLocale

      protected String getTextFromLocale(String key, String defaultValue)
    • getTextFromLocale

      protected String getTextFromLocale(String key, String defaultValue, Object... args)
    • getText

      public String getText(String aTextName)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String aTextName, String defaultValue)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String aTextName, String defaultValue, String obj)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String aTextName, List<?> args)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String key, String[] args)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String aTextName, String defaultValue, List<?> args)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String key, String defaultValue, String[] args)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String key, String defaultValue, List<?> args, com.opensymphony.xwork2.util.ValueStack stack)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getText

      public String getText(String key, String defaultValue, String[] args, com.opensymphony.xwork2.util.ValueStack stack)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
    • getTexts

      public ResourceBundle getTexts(String bundleName)
      Specified by:
      getTexts in interface com.opensymphony.xwork2.TextProvider
    • getTexts

      public ResourceBundle getTexts()
      Specified by:
      getTexts in interface com.opensymphony.xwork2.TextProvider