hosted mode with custom web.xml

Skip to first unread message


Nov 3, 2006, 3:03:50 PM11/3/06
to Google Web Toolkit

is it possible to run a gwt project in hosted mode which requires a
custom web.xml?
i.e. I need to read parameters from the web.xml in init().

Thank you!

Nov 3, 2006, 7:50:34 PM11/3/06
to Google Web Toolkit
I am not sure of the ideal way to solve this issue but I have run into
the same problem and another related issue. For the record I will
elaborate what the 2 things are:

1. I want to use a deployment descriptor that is local to my app
because of other filters, parameters, realms, etc, apart from just GWT
servlets (for which you can create mock objects). I want that
deployment descriptor to matter in Hosted Mode.

2. I want whatever GWT service servlet entries are in my GWT module to
also be deployed automatically with my applications deployment
descriptor (automatically merged into any local web.xml) without having
to maintain the entries in two places (without having to define the
module stuff AND duplicate it in a deployment descriptor that is
deployed with the app).

Your question is the same as item 1. For that what I have been doing
is munging the web.xml that the GWT development tomcat instance uses.
tomcat\webapps\ROOT\WEB-INF\web.xml. This seems to work but it's not
ideal because it means I have to maintain the entries in the deployment
descriptor in two files (my apps web.xml which is deployed with the
app, and the GWT ROOT web.xml).

For item 2, I have been experimenting with having a build process,
Maven, inspect and merge the .gwt.xml module file servlet entries with
the applications specific web.xml. This is being enabled at present
via a GWT Maven plugin ( I am
using the Maven 1 version of the plugin, which takes the module file
servlet entries and creates relevant servlet and servlet-mapping
entries in the deployment artifact web.xml (not in the source web.xml,
the source one has all the other stuff, init params, realms, other
servlets, so on - and it is not modified, but the final one deployed is
that source file PLUS GWT servlet entries that are added automatically
by the build/deploy process).

There certainly may be better ways to do this stuff, but I haven't run
across them yet, I think most people are just maintaining duplicate
entries in both cases. If anyone has any other ideas on this front
please advise.

Reply all
Reply to author
0 new messages