I am working on a Java web app- it will use GWT for the front end.
I understand that for the package com.abc.xyz, client side code will be in com/abc/xyz/client, while server side code will be in com/abc/xyz/server
The same web app also has some purely java code, eg a listener which waits for new items to be added to a queue- the application should then process items in the queue.
This code is partly in the package com.abc.xyz, as well as in some other packages- com.qwerty.package and com.pqr.zzz
Am I correct in thinking that the above type of app can be created as a combination of GWT and Java code?
How do I arrange the code of the packages mentioned above, in my src folder. Also, how do I get the final application- which consists of some pages created using GWT, as well as some purely server side code (like listeners)- will the entire generated code (consisting of JS/HTML from GWT and server side Java code used by GWT as well as pure Java code used by server side listener)- do I run it as web application under Google Menu in Eclipse? Will this automatically create the desired java war file correctly?
Also, I plan to use Smart GWT for the front end part- will this mean some change in the procedure when compared to pure GWT applications?
Am I correct in thinking that the above type of app can be created as a combination of GWT and Java code?
GWT is Java code, the client part will be compiled into Javascript. You can use any Java API in the services on the server side, in my current project I'm using among others Swing, JPA, Hibernate, Guice, log4j and access MongoDB and Mysql databases.
How do I arrange the code of the packages mentioned above, in my src folder.
This is my layout:
src/main/java:
org.foo.bar.client - GWT client code (activities, events, MVP, places, entry point class)
org.foo.bar.controller - one Swing MVC Controller for my login page (I handle login outside of GWT at the moment)
org.foo.bar.security - My Spring Security classes (Authentication Listener/Provider etc.)
org.foo.bar.server.repository - Spring JPA repositories
org.foo.bar.server.service - RPC services
org.foo.bar.shared - domain classes (JPA entities), they are used both by the client and server
src/main/resources:
org/foo/bar/client/ - property files (constants and messages) for internationalization
META-INF/persistence.xml - for JPA
log4j - logging configuration
do I run it as web application under Google Menu in Eclipse
A GWT project generated in Eclipse contains a working ant build script that can create a war for you. You can then deploy it in your web container of preference like Tomcat, Jetty... However the compilation (the part that generates the client javascript) takes a long time so for testing use the GWT development mode in Eclipse - you'll have to install a plugin for your web browser to take advantage of it.