Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Spring integration

    Hi,
    I've read the forum about a response and the only response I found was to look at the smartGWT EE showcase. So I did but I found no reference how to integrate Spring beans in smartGWT.

    Here is my question : how do I do to make annotations such as @Autowired work in a SmartGWT object ?

    Here is my sample :
    Code:
    public class LoadingUnitDataSource extends BasicDataSource {
    	public static final Logger logger = LoggerFactory.getLogger(LoadingUnitDataSource.class);
    	private TransportService transportService  ;
    	public LoadingUnitDataSource() {
    		super();
    	}
    	
    	...
    
    }
    This is the datasource I use. I wish to use that service to fetch the data but when I try to access the transportService, I get a NullPointerException ... But a datasource been has been declared like this :
    Code:
    <bean id="loadingUnitDataSource" class="com.alea.server.datasource.LoadingUnitDataSource">
    	<property name="transportService" ref="transportService" />
    </bean>
    Is it possible to do so ? If yes, how ? Thanks.

    #2
    Two ways:

    1. a DMI where the serverObject has lookupStyle="spring" (shown in the EE Showcase)

    2. a custom DataSource where serverConstructor is set to "spring:beanId".

    The latter feature is brand new, so grab a nightly if you like that approach better.

    Comment

    Working...
    X