mergewebxml url-pattern control

6 views
Skip to first unread message

Justin Smith

unread,
Mar 20, 2007, 8:28:12 PM3/20/07
to gwt-maven
Hello! I had a question about the mergewebxml goal. Is there any way
to configure the url-pattern that the servlet is mapped to? I've
looked around the docs and source and it doesn't seem possible, but
maybe I'm missing something.


Right now, it's giving me the following results:

--- Project.gwt.xml ---

<servlet path="/service" class="com.my.server.ServiceImpl">

--- web.xml ---

<servlet>
<servlet-name>com.my.server.ServiceImpl/com.my.Project/service</
servlet-name>
<servlet-class>com.my.server.ServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>com.my.server.ServiceImpl/com.my.Project/service</
servlet-name>
<url-pattern>/com.my.Project/com.my.Project/service</url-pattern>
</servlet-mapping>


This is causing me to update my source code to point to the new url-
pattern to actually get a connection in web mode, which THEN causes
the connection to fail in hosted mode.

So is there a configuration option to control the url-pattern mapping?

Thanks!
Justin

Brill

unread,
Mar 24, 2007, 5:41:58 PM3/24/07
to gwt-maven
I just went though the same pain to get the thing to deploy.
Obviously the url on the client side will depend on how you construct
it, but that was a real mess to get working...

- Brill


Robert "kebernet" Cooper

unread,
Mar 24, 2007, 9:09:26 PM3/24/07
to gwt-...@googlegroups.com
Well, the original point of mergewebxml was to replicate the pattern of the GWTShellServlet, so the module base path prefix is the way the shell deploys it. Generally, you are already doing :

endpoint.setServiceEntryPoint (GWT.getModuleBaseURL() + "/MyService");

While the GWTShell *will* fallback to /MyService as a path, this doesn't take into account the context prefix of your deployed  WAR in production since GWTShell runs the context as the root context.


kebe...@gmail.com
Alice's cleartext
Charlie is the attacker
Bob signs and encrypts
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x9E8759F8

Brill

unread,
Mar 25, 2007, 12:40:04 PM3/25/07
to gwt-maven
O, so would it work to just use:
Strng baseUrl = GWT.getModuleBaseURL();
baseUrl = baseUrl .substring(1,baseUrl.length());
endpoint.setServiceEntryPoint(baseUrl +"/MyService");

to make it relative?

- Brill

On Mar 24, 9:09 pm, "Robert \"kebernet\" Cooper" <keber...@gmail.com>
wrote:


> Well, the original point of mergewebxml was to replicate the pattern of the
> GWTShellServlet, so the module base path prefix is the way the shell deploys
> it. Generally, you are already doing :
>

> endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "/MyService");


>
> While the GWTShell *will* fallback to /MyService as a path, this doesn't
> take into account the context prefix of your deployed WAR in production
> since GWTShell runs the context as the root context.
>

> On 3/24/07, Brill <b...@pappin.ca> wrote:
>
>
>
> > I just went though the same pain to get the thing to deploy.
> > Obviously the url on the client side will depend on how you construct
> > it, but that was a real mess to get working...
>
> > - Brill
>

> --
> :Robert "kebernet" Cooper
> ::keber...@gmail.com

dan

unread,
Apr 5, 2007, 12:40:24 PM4/5/07
to gwt-maven
So ... how do we get rid of the double package name in the URL
pattern?

On Mar 25, 12:40 pm, "Brill" <b...@pappin.ca> wrote:
> O, so would it work to just use:
> Strng baseUrl = GWT.getModuleBaseURL();
> baseUrl = baseUrl .substring(1,baseUrl.length());
> endpoint.setServiceEntryPoint(baseUrl +"/MyService");
>
> to make it relative?
>
> - Brill
>
> On Mar 24, 9:09 pm, "Robert \"kebernet\" Cooper" <keber...@gmail.com>
> wrote:
>

> > Well, the original point of mergewebxml was to replicate thepatternof the


> > GWTShellServlet, so the module base path prefix is the way the shell deploys
> > it. Generally, you are already doing :
>
> > endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "/MyService");
>
> > While the GWTShell *will* fallback to /MyService as a path, this doesn't
> > take into account the context prefix of your deployed WAR in production
> > since GWTShell runs the context as the root context.
>
> > On 3/24/07, Brill <b...@pappin.ca> wrote:
>
> > > I just went though the same pain to get the thing to deploy.

> > > Obviously theurlon the client side will depend on how you construct

Justin Smith

unread,
Apr 16, 2007, 7:54:56 PM4/16/07
to gwt-maven
I'm wondering the same thing. The mergewebxml goal does fine if I'm
running my application through the GWTShell, but when I deploy to
Tomcat it can't find the service because it's listening on {project-
path}/{project-path}/{service-name} instead of just {project-path}/
{service-name}

Is this on purpose or is there a work around?

Justin

Reply all
Reply to author
Forward
0 new messages