Now we will add spring framework to this project. Normally I use maven to manage j2ee projects,but with GWT, I've spent a lot of time(with the GWT maven plugin) and still can't make the IDE and maven work together very well. So I decided only use maven to manage the dependencies and leave the rest to eclipse.
Attached file is my demo project(windows, eclipse3.7 with google plugin) , I think a experienced programmer would prefer trying that first. The demo also includes some design/widgets I created based on my experience and needs.
It should work straight away. (rightclick->run as->web application) .
in /libs there is the pom.xml with all dependency. Inside this file you can see
<outputDirectory>../war/WEB-INF/lib</outputDirectory>
which pointing to the output directory.
you can run mvn process-resources, that will fetch all dependency jars to war/WEB-INF/lib.
In WEB-INF, I put 3 xml files in the spring folder as usual. and web.xml needs to modify. (see my demo)
you may need to change <context:component-scan> to specify the package to scan.
In datasource.xml , this line tells spring to look for "config.properties" in classpath
<context:property-placeholder location="classpath:config.properties" />
I feel there is no need to explain normal spring stuffs, let me know if you have questions about my demo.
No comments:
Post a Comment