|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bbqjs.spring.debug.LanguageController
@Controller public class LanguageController
A version of the LanguageController meant for development. Attempts to dynamically create the language file for every request - not recommended for production. Sample Spring configuration:
<bean id="languageController" class="org.bbqjs.spring.debug.LanguageController">
<property name="defaultLocale" value="en_GB"/>
<property name="supportedLocales">
<list>
<value>en_GB</value>
<value>en_US</value>
</list>
</property>
<property name="pagePackage" value="${js.page.package}"/>
<property name="sourceRoots">
<list>
<value>src/main/javascript</value>
</list>
</property>
</bean>
Nested Class Summary | |
---|---|
static class |
LanguageController.LanguageRequest
This class is used to request a given language translation file |
Constructor Summary | |
---|---|
LanguageController()
|
Method Summary | |
---|---|
Map<Object,Object> |
getLanguage(LanguageController.LanguageRequest request,
Locale locale)
The controller method. |
protected Map<Object,Object> |
getLanguageFile(Object byName,
Locale forLocale)
Compiles and returns a language translation section. |
void |
setDefaultLocale(Locale defaultLocale)
When no language translation exists for a given term, fall back to this locale. |
void |
setPagePackage(String pagePackage)
The ${js.page.package} from your pom. |
void |
setSourceRoots(String[] sourceRoots)
Where to look for language files - a suggested value is "src/main/javascript". |
void |
setSupportedLocales(List<Locale> supportedLocales)
A list of locales that your application supports. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LanguageController()
Method Detail |
---|
@RequestMapping(value="/language/get", method=POST) @ResponseBody public Map<Object,Object> getLanguage(@RequestBody LanguageController.LanguageRequest request, Locale locale) throws IOException
request
- locale
-
IOException
protected Map<Object,Object> getLanguageFile(Object byName, Locale forLocale) throws IOException
byName
- forLocale
-
IOException
public void setSupportedLocales(List<Locale> supportedLocales)
supportedLocales
- public void setDefaultLocale(Locale defaultLocale)
defaultLocale
- public void setSourceRoots(String[] sourceRoots)
sourceRoots
- public void setPagePackage(String pagePackage)
pagePackage
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |