Joe Cole
unread,Jan 1, 2009, 3:03:35 AM1/1/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
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>