java - AcceptHeaderLocaleResolver error -
i have defined "localeresolver" bean in spring configuration file as
<bean id="localeresolver" class="org.springframework.web.servlet.i18n.acceptheaderlocaleresolver"> <property name="defaultlocale" value="language" /> </bean>
user hits url change locale /setlocale.do?language=fr
getting exception java.lang.unsupportedoperationexception:
before method called. in order solve have use sessionlocaleresolver
is there anyway don't have use sessionlocaleresolver
.
have @ implementation of acceptheaderlocaleresolver
, think name bit.
note: not support setlocale, since accept header can changed through changing client's locale settings.
acceptheaderlocaleresolver
resolve locale
request (using accept header) , that's it. there no way set locale property different value. if need locale changeable stuck sessionlocaleresolver
. there's option write own resolver if existing ones don't suit goal.
Comments
Post a Comment