NedStarkOfWinterfell
NedStarkOfWinterfell

Reputation: 5153

Deploying GWT RPC app in Tomcat

As per the Google tutorial, I have developed the basic StockWatcher application, that makes an RPC call to the server, which sends some data, which is displayed on the client.

I now want to deploy it in Tomcat, such that if call something like localhost/StockWatcher, I should get the same experience as when running the app from GWT in development mode.

How do I do this? There is a similar topic here, but I couldn't much understand it. If I only copy the compiled war folder, what happens to the GreetingServiceImpl class which handles the RPC? And how do I do the mapping such that localhost/StockWatcher maps to localhost:8080 (something like Mod_Rewrite)?

Upvotes: 0

Views: 1534

Answers (2)

Houcem Berrayana
Houcem Berrayana

Reputation: 3080

Normally if you deploy well your war directory and you are able to start tomcat you have done everything. If you access your page using this url : localhost:8080/StockWatcher gwt will know that it must use that url as a baseURL for all gwt/rpc requests.

To generate the war using Eclipse : right click on the project -> export -> war. You will have the war exported with all the dependencies inside. just unzip it in the ROOT directory

Upvotes: 1

Suresh Atta
Suresh Atta

Reputation: 121998

Steps to deploy war on TOMCAT

    1)Compile you gwt web application
    2)Copy  the war file 
    3)Add all libraries(jar files) in lib folder of war file 
    4)Rename your war as "myapp"
    5)create a .war file with that "myapp" folder
    6)start tomcat with catalina.bat run.

For step5 (generating .war file ):Preparing .war file from command line

Upvotes: 1

Related Questions