On 6 Feb, 13:10, Charlie Collins <
charlie.coll...@gmail.com> wrote:
> Very comprehensive post there Johan, good work and nice write up.
>
Thank you.
> I would note though that I do think you went through a few extra
> steps. GWT-Maven can copy a SOURCE web.xml file (and context.xml file
> for Tomcat) over to the hosted mode Tomcat locations for you,
> automatically.
I struggled with this but could not get it working. Maybe I am not the
tomcat wizard that I have to be to know the inner workings of that
container.
> You can use the built in Tomcat with GWT-Maven to do
> absolutely anything that an external Tomcat can do.
This was new for me. My impression from other posts is that I have to
use the external Tomcat when reading from the server file system or
doing other 'advanced' things. I use iBatis and when I wanted to load
the ibatis config file I tried to get the servlet context for file
access. In the built-in tomcat I got null but the external tomcat gave
me the real context. Maybe I didn't configure the built-in Tomcat as I
should have done.
> GWT-Maven adds the
> deps, sets up the web.xml and context.xml, etc. Also, GWT-Maven keeps
> the same config when it builds a WAR, so you know that your hosted
> mode stuff is the same as your WAR once you deploy.
>
> If you have src/main/webapp/WEB-INF/web.xml in your project, GWT-Maven
> will use it and *merge* it with the embedded Tomcat ROOT.xml (same for
> context.xml - and you can change the paths with config params, the
> defaults that are normally used are the Maven conventions).
>
I have an empty web.xml which gwt-maven modifies but I never
understood how-to deal with the context, which might explain my
comment above.
> The reasons to keep with the embedded Tomcat are several, sharing
> modules with others (if you use noserver, you pass on all the
> configuration outside of your build, you have to provide instructions
> and deps, etc), and testing (GWTTestCase tests won't work with
> noserver in hosted mode).
>
I can tell you, I would have preferred using the embedded cat in this
setup.
> That said though, GWT-Maven also includes support for noserver too.
> If you add a the "noServer" configuration parameter, and then set the
> runTarget to your external URL, it will not launch the embedded
> Tomcat, and instead will hit the external one.
>
This feature is what I use in my pom.xml
> If you feel like we need to add more documentation, or do a better job
> of explaining stuff on the GWT-Maven site (or you have any other GWT-
> Maven issues/suggestions) please ping me. I am trying to clean all of
> that up and improve it.
>
The issue with my context configuration might be more gwt related, but
could most probably be solved by gwt-maven, right?
Well, I tried to tie together gwt-maven with eclipse and this is
something I would like to have without all the manual configuration
needed.
I would like to get this setup easier to achieve so maybe we can start
by getting rid of the external Tomcat and I'll update my blog post
accordingly.
VBR
johan