GWTP icon indicating copy to clipboard operation
GWTP copied to clipboard

Impossible to specify custom dispatchClass (Spring)

Open valsoray17 opened this issue 10 years ago • 3 comments

In the class com.gwtplatform.dispatch.rpc.server.spring.DispatchModule there is a non-default constructor which allows to pass the custom dispatchClass as a parameter.

However DispatchModule (essentially Spring configuration) is instantiated by Spring and there is no way to call non-default constructor and override the dispatchClass (at least I didn't find how to do that).

Can we consider changing the Spring-based configuration to allow custom dispatchClass?

Thanks

valsoray17 avatar Sep 08 '14 15:09 valsoray17

I believe the constructor have always been public, unless you've written the wrong class name

meriouma avatar Feb 28 '15 18:02 meriouma

It is public, but that's not the point. For example to override Dispatch class I have to create CustomHandlerModule, which in turn imports CustomDispatchModule and in this custom dispatch module specify custom dispatchClass

So to override the dispatch class I need to create 2 additional classes (because HandlerModule imports Dispatch module via annotation). Hope this makes sense

valsoray17 avatar Mar 02 '15 16:03 valsoray17

Ah I see, thanks for the clarifications

meriouma avatar Mar 02 '15 16:03 meriouma