How to setup GWT for Tomcat?

前端 未结 4 550
傲寒
傲寒 2021-02-14 08:43

I am new to GWT and learning it via the the Google documents. How do I setup GWT with Tomcat? I am required to intergrate it with Tomcat for work purposes.

4条回答
  •  悲哀的现实
    2021-02-14 09:05

    I use GWT-SDK webAppCreator command (from terminal) and it generates all the files required to run on an external server like Tomcat.

    I will provide the steps i followed in order to help others begin with simple GWT-TOMCAT development

    TOMCAT

    1. Download a Tomcat version, i prefer Tomcat 6 http://apache.tsl.gr/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip
    2. Follow the instructions for your specific operation system in order to install it. I followed this tutorial (MAC-OS) http://www.malisphoto.com/tips/tomcatonosx.html

    GWT

    1. Download a GWT-SDK version (i use 2.0.4 which i find more stable and compatible with external sources like EXT-GWT library and TOMCAT) http://code.google.com/p/google-web-toolkit/downloads/list
    2. Open your TERMINAL if you are a UNIX user then change directory to the GWT-SDK you just downloaded
    3. Change permissions to run webAppCreator script. I usually modify permissions of all files by typing - > chmod 750 *
    4. Create a GWT project by executing in terminal -> ./webAppCreator -out MyProject com.myproject
    5. All files are automatically generated
    6. Switch directory to the project you just created, type in terminal -> cd MyProject
    7. Compile your project with the ant script provided by the GWT-SDK, type in terminal -> ant build
    8. Open you project and copy it's build.xml file, war/ contents to Tomcat's webapps/ROOT folder
    9. FINALLY open your browser type localhost:8080/ to run your project (It will open your project .html page by default because it is defined inside /WEB-INF/web.xml file)

    Congratulations!

提交回复
热议问题