Deploying GWT to Tomcat
Posted by ulyssesp on 2008-12-08 19:21
Important: if you don't have RPC calls then you only need to copy the www/{classpath} directory into the {Project}/ directory in tomcat... If you use those ever so complicated server calls, then read on!
Ok, so finding out how to deploy to tomcat is a pain in the royal behind. There are lots of articles claiming to know how to do it, but they're all over the place.
Here's something to make it a bit easier, and hopefully at some point we'll have an automatic build script going:
1. Change any RPC calls to referance "/{Project}/server" instead of just "/server" when you make the RPC call, not in the .xml
2. Compile using the {Project}-compile.cmd
3. Copy the files from your bin directory in gwt into the {Project}/WEB-INF/classes/ in tomcat
4. Copy all the jars you need into {Project}/WEB-INF/lib/ including the gwt-user.jar (you don't need the gwt-{OS}-dev.jar)
5. Copy the files in your www/{Classpath} directory into your {Project}/ directory in tomcat and change the name of the main html file to index.html
6. Create a web.xml in the {Project}/WEB-INF folder in tomcat, with the following format:
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<servlet>
<servlet-name>{RPC Service Name}</servlet-name>
<servlet-class>{RPC Servlet Impl}</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>{Servlet name}</servlet-name>
<url-pattern>/{Servlet directory}</url-pattern>
</servlet-mapping>
</web-app>
7. Start up tomcat, and it's there!
Information taken from the posts in
http://specialproject07.wordpress.com/2007/12/04/deploying-a-gwt-application-using-tomcat/
Email me if you have a question!
- ulysses.popple@gmail.com
Ok, so finding out how to deploy to tomcat is a pain in the royal behind. There are lots of articles claiming to know how to do it, but they're all over the place.
Here's something to make it a bit easier, and hopefully at some point we'll have an automatic build script going:
1. Change any RPC calls to referance "/{Project}/server" instead of just "/server" when you make the RPC call, not in the .xml
2. Compile using the {Project}-compile.cmd
3. Copy the files from your bin directory in gwt into the {Project}/WEB-INF/classes/ in tomcat
4. Copy all the jars you need into {Project}/WEB-INF/lib/ including the gwt-user.jar (you don't need the gwt-{OS}-dev.jar)
5. Copy the files in your www/{Classpath} directory into your {Project}/ directory in tomcat and change the name of the main html file to index.html
6. Create a web.xml in the {Project}/WEB-INF folder in tomcat, with the following format:
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<servlet>
<servlet-name>{RPC Service Name}</servlet-name>
<servlet-class>{RPC Servlet Impl}</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>{Servlet name}</servlet-name>
<url-pattern>/{Servlet directory}</url-pattern>
</servlet-mapping>
</web-app>
7. Start up tomcat, and it's there!
Information taken from the posts in
http://specialproject07.wordpress.com/2007/12/04/deploying-a-gwt-application-using-tomcat/
Email me if you have a question!
- ulysses.popple@gmail.com
Home / Developer API / Tour / Get a Project - Solutions for Bug & Issue Tracking, Collaboration Tools, Subversion Hosting, Git Hosting
Ahs webdev is powered by Assembla.
0 Comments