Tuesday, 27 March 2012

GWT Spring Hibernate/JPA (part 1)

In eclipse, using Dynamic Web Project is the most easy way to develop/debug a spring powered j2ee project. However when developing GWT apps, it's a shame not to use google's eclipse plugin, which will set the project as a "Web Application Project".

The first part will tell you how to create a eclipse project has both facets.

First you need to have the Eclipse IDE for Java EE Developers (http://www.eclipse.org/downloads/)

1 create a google GWT project with Google eclipse plug-in. (install it if you haven't https://developers.google.com/eclipse/ )

2 right click project,  properties-> project facet-> convert to facet form -> check dynamic web module facet in the list.

3 using Windows Explorer, navigate to the project folder -> ./settings -> org.eclipse.wst.common.component, open this file with any text editor,

modify this line:
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
to
<wb-resource deploy-path="/" source-path="/war" tag="defaultRootSource"/>
then refresh the project in eclipse.



After these simple steps the project is configured as google gwt project and also a WTP project.
That allows this project to be run/debugged as a GWT app or a normal web app. (right click->run as)

No comments:

Post a Comment