Create Simple Application
Example code is available on github.com/vaadin-on-grails/spring-autowiring-basics.
In this tutorial, we will create Vaadin application where we can use @Autowired
annotation.
Step 1
We need to say the plugin that we want to do annotation based URL mapping. Comment out mapping from VaadinConfig.groovy
to do that.
Step 2
Now we will create a dummy service ItemService
that we will autowire in Vaadin code.
Step 3
Use @VaadinUI
annotation to map your UI class to URL.
That is all, now you can run the application and ItemService
will be autowired.
Step 5
Run the application grails run-app
and open http://localhost:8080/spring-autowiring-basics in a browser.
Last updated