-
Notifications
You must be signed in to change notification settings - Fork 2
GWT Integration Spring Web
apetrelli edited this page May 3, 2013
·
1 revision
The gwt-integration-spring-web helps to integrate GWT and the Spring Web.
The problem: GWT Client locale (via the "locale" parameter) and the server locale are not in sync usually. This is useful for server-generated messages, like server-side validation.
The solution: Transmit the locale by using LocaleRequest and use RequestContextFilter, SessionLocaleHolderListener and SpringWebApplicationContextHolderListener.
Configure RequestContextFilter, SessionLocaleHolderListener and SpringWebApplicationContextHolderListener in your web.xml file:
<listener>
<display-name>application-context-holder</display-name>
<listener-class>com.github.apetrelli.gwtintegration.spring.web.SpringWebApplicationContextHolderListener</listener-class>
</listener>
<listener>
<display-name>session-locale-holder</display-name>
<listener-class>com.github.apetrelli.gwtintegration.spring.web.SessionLocaleHolderListener</listener-class>
</listener>
<filter>
<filter-name>RequestContextFilter</filter-name>
<filter-class>com.github.apetrelli.gwtintegration.spring.web.RequestContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>RequestContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
TODO: WE NEED AN EXAMPLE BEFORE COMPLETING THIS DOC.