I’m getting closer! I think I may still end up needing some help. After looking at http://dev.vaadin.com/browser/incubator/SpringApplication I realized I don’t have a clue about Spring so I did the following:
- I downloaded spring-framework-2.5.6-with-dependencies.zip
- Unzipped a fresh copy of apache-tomcat-6.0.20
- Started going through the step by step tutorial for building a Spring app from scratch.
I was amazed by the tutorial. For those who have never played with Spring, the tutorial is found in:
/spring-framework-2.5.6/docs/MVC-step-by-step/html_single/index.html
So, now I’m trying to figure out…can I get Vaadin to work with this setup or do I need to start over and use the one that is found at http://dev.vaadin.com/browser/incubator/SpringApplication?
I’ll probably end up attempting both, but I’m so in love with the quality of the experience that I had with the Spring tutorial that I want to plug Vaadin into that first.
If anyone has advice on what I need to do, let me know. In the meantime, I’ll be trying to compare my setup with what is found at http://dev.vaadin.com/browser/incubator/SpringApplication and the instructions at http://vaadin.com/wiki/-/wiki/Main/Spring%20Integration?p_r_p_185834411_title=Spring%20Integration
. I plan on using the annotations approach to get to the bean if possible.
Any tips are greatly appreciated. Below are some brief notes on the resulting setup from going through the Spring tutorial:
- Setup structure:
- build.properties
- build.xml
- db
- src
--- springapp
----- domain
----- repository
----- service
----- web
- test
- war
--- WEB-INF
----- web.xml
----- springapp-servlet.xml
----- applicationContext.xml
----- classes
----- jsp
----- lib
------- aspectjweaver.jar
------- commons-dbcp.jar
------- commons-logging.jar
------- commons-pool.jar
------- hsqldb.jar
------- jstl.jar
------- junit-3.8.2.jar
------- spring-test.jar
------- spring-webmvc.jar
------- spring.jar
------- standard.jar
---- tld
-
src/springapp/domain classes are simple POJOs.
-
src/springapp/repository classes are DAO classes that use org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport
-
src/springapp/service classes are simple Java classes that use the DAO/Model and are called from the controllers.
-
src/springapp/web classes are controllers that use org.springframework.web.servlet.mvc.Controller, extend Controller, make calls to the service classes, handle the servlet request, return an instance of org.springframework.web.servlet.ModelAndView, and are configured in springapp-servlet.xml and applicationContext.xml.
-
I’m expecting to add vaadin-6.1.4.jar to either WEB-INF/lib or to my tomcat/lib.
-
Based on what I’m seeing in http://dev.vaadin.com/browser/incubator/SpringApplication I’m going to add a ui and util directory to my src/springapp. For the other directories, mappings from SpringApplication to my setup are: model=domain, servlet=web, service=service.
8. This is where I’ll probably need help: I’m going to attempt to translate the differences in SpringApplication/…/applicationContext.xml and web.xml to somehow work with my setup. This is the grey area to me. I was able to get Vaadin working with tomcat and basic servlets but I’m not sure what I’ll run into trying to get Vaadin working with a fresh install of Spring.
I’ve also attached my setup. Sorry for the long post but I’m way excited about all of this. Our current technology stack was developed in 1999. All we had back then were servlets. We currently persist our own data, are stuck with FreeMarker classic, compile with SQLJ, and have our own blasted “controller” classes using Java reflection. The stuff I’m seeing with Spring and Vaadin are seriously blowing my mind!! Seam is cool also and RoR also blows my mind (Ruby syntax/constructs alone), but I think Spring with Vaadin will continue to be a serious contender for our use. With RoR I’m also still not fully convinced about the performance of ActiveRecord.
I also apologize in advance if what I’m trying to do is not unique and has already been detailed in this forum. I tried reading through all the posts but I still get lost in what I read.
If this works, I’ll be able to have my developers do a fresh install of tomcat and Spring using the Spring step by step tutorial and then apply Vaadin. Please correct me if I’m wrong, but I think this is a good approach for a newbie to learn tomcat/Spring/Vaadin. So, here goes and thanks for any help!
BTW, had to remove the jars in war/WEB-INF/lib, attachment was too large. I added a readme to the lib in case anyone wants to get the jars and deploy this with tomcat. If you do, you will also need to edit the build.properties to find tomcat and you will also need to follow the spring tutorial to run the db. Personally, I think you learn so much more from going through the tutorial from scratch.
11128.gz (22.3 KB)