-
Notifications
You must be signed in to change notification settings - Fork 2
GWT Integration Spring Context
The gwt-integration-spring-context
helps to integrate GWT and the context-related part of Spring, with no connection to a servlet-based environment.
- RequestFactory should use Spring-managed services
- The validator should be a Spring-managed bean
- Client and Session locale are not in sync
The problem: Suppose that you use RequestFactory against a service layer. The services should be taken from the Spring context.
The solution: Use GwtServiceLocator
.
Inspired by Spring Roo, the GwtServiceLocator must be configured in your request annotation:
@Service(value = PersonService.class, locator = GwtServiceLocator.class)
public interface PersonRequest extends CrudRequest<PersonProxy, Long> {
...
}
If you are under a servlet environment you need also to:
- use
CustomServiceLayerDecorator
in your customRequestFactoryServlet
; - use
SpringWebApplicationContextHolderListener
.
The problem: The Bean Validation validator should be taken from Spring Context.
The solution: Use CustomServiceLayerDecorator
in your custom RequestFactoryServlet
.
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
.
TODO: WE NEED AN EXAMPLE BEFORE COMPLETING THIS DOC.