You can instantiate the LanguageUtils object and call methods from Java/JSP.
This approach provides the same convenience methods as the static approach, but simplifies the method signatures by removing the need to specify the request on every call. This may be useful for developers who make many calls for localized strings and would prefer to instantiate the object once and simplify the subsequent method calls.
<%@ page import="com.endeca.portlet.util.LanguageUtils" %> <% LanguageUtils lang = new LanguageUtils(renderRequest); %> <%= lang.getMessage("reset") %> <%= lang.getMessage("num-records", "Num records:") %> <%= lang.getMessage("search-for", "Search for \"{0}\"", new String[]{ "American" }) %>