I have run into this problem a few times, so thought it may be worth
posting for others.
We wanted to be able to produce the html files via a framework like
freemarker, jsp, wicket etc in hosted mode. It turned out to be
trivial.

public class CustomShellServlet extends GWTShellServlet {

        IRoutes routes;

        @Override protected void doGet(final HttpServletRequest request,
final HttpServletResponse response) throws ServletException,
IOException {
                if (routes.hasExplicitRouteFor(request.getRequestURI())) {
                        router.service(request, response);
                        return;
                }
                super.doGet(request, response);
        }
}

All you need to do is override the requests for the html files
themselves. In my example it uses an internal class we use, but can
easily work with freemarker templates or other view technologies.

The only configuration change was replacing gwtshellservlet in the
tomcat/webapps/ROOT/WEB-INF/web.xml to:

       <servlet>
                <servlet-name>shell</servlet-name>
                <servlet-class>com.your.packagename.CustomShellServlet</servlet-
class>
        </servlet>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to