How to use GWT war file as welcome page in Apache Tomcat (TomEE)/8.5.6 (7.0.2).

89 views
Skip to first unread message

Ananchai Srirochanakul

unread,
Aug 7, 2017, 5:12:17 PM8/7/17
to GWT Users
Hi,

As you can see from the images below, I have a GWT war file, that is working in Apache Tomcat (TomEE)/8.5.6 (7.0.2).
However, I want to be able to use it as a welcome page in TomEE. For example, by typing the URL "www.mygwt.com", I should see this GWT war file as the very first page.






The content of web.xml is pasted below.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

  <!-- Servlets -->
  <servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>com.google.gwt.sample.stockwatcher.server.GreetingServiceImpl</servlet-class>
  </servlet>
 
  <servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/stockwatcher/greet</url-pattern>
  </servlet-mapping>
 
  <!-- Default page to serve -->
  <welcome-file-list>
    <welcome-file>StockWatcher.html</welcome-file>
  </welcome-file-list>

</web-app>

Some of content of /tomcat/conf/web.xml is pasted below.

 <!-- ==================== Default Welcome File List ===================== -->
  <!-- When a request URI refers to a directory, the default servlet looks  -->
  <!-- for a "welcome file" within that directory and, if present, to the   -->
  <!-- corresponding resource URI for display.                              -->
  <!-- If none welcome file are present, the default servlet either serves  -->
  <!-- a directory listing (see default servlet configuration on how to     -->
  <!-- customize) or returns a 404 status, depending on the value of the    -->
  <!-- listings setting.                                                    -->
  <!--                                                                      -->
  <!-- If you define welcome files in your own application's web.xml        -->
  <!-- deployment descriptor, that list *replaces* the list configured      -->
  <!-- here, so be sure to include any of the default values that you wish  -->
  <!-- use within your application.                                         -->

    <welcome-file-list>
        <welcome-file>stockwatcher</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>

However, I cannot get it to work.
I hope someone can help.

Thank you so much.

Craig Mitchell

unread,
Aug 9, 2017, 1:52:09 AM8/9/17
to GWT Users
This isn't really a GWT question, but what I would do is:
1. Undeploy the "Welcome to Tomcat" app that is currently in root.
2. Rename your war file to ROOT.war, and deploy it.

You should now have your GWT app at root.

Ananchai Srirochanakul

unread,
Aug 25, 2017, 1:47:35 PM8/25/17
to GWT Users
Thank you so much. Eventually, I ended up changing a lot of configuration, and I decided to drop this tutorial of mine.
Reply all
Reply to author
Forward
0 new messages