debug in hosted

1 view
Skip to first unread message

archer

unread,
Mar 15, 2007, 1:54:51 PM3/15/07
to gwt-sl
Hello.
I've read your articles and using GWTHandler now in our project. Can
you please explain in more details how to force use of GWTHandler
(instead of standard GWT mappings) using hosted mode?

I guess that there must be some like web.xml, used internally, where
I've to put mapping to <servlet-
class>org.springframework.web.servlet.DispatcherServlet</servlet-
class>, but I just can't find it for some reason.

George Georgovassilis

unread,
Mar 16, 2007, 4:27:27 AM3/16/07
to gwt...@googlegroups.com
Hello archer

When you say 'hosted mode' you are referring to both the hosted mode browser and the tomcat it starts? In this case, you cannot use the GWTHandler because it is started through a DispatcherServlet while GWT insists on exposing it's own GWTShell servlet. You can use the hosted mode browser though with an external webserver by using the -noserver argument on it, you can read up the GWT FAQ on how to do this.

Robert Hanson

unread,
Mar 16, 2007, 9:36:19 AM3/16/07
to gwt...@googlegroups.com
> In this case, you cannot use the GWTHandler
> because it is started through a DispatcherServlet
> while GWT insists on exposing it's own GWTShell servlet.

What I have done in the past, for various reasons, is to change the
mapping for the GWTShell servlet.

I edit tomcat/webapps/ROOT/WEB-INF/web.xml, changing the shell mapping to this:

<servlet-mapping>
<servlet-name>shell</servlet-name>
<url-pattern>/shell/*</url-pattern>
</servlet-mapping>

Then I change the arguments for the launch script to what you see
below, adding "shell/" to the beginning of the HTML file path.

-out www shell/org.globix.crw.CRWClient/CRWClient.html

Then I can add other mappings to the web.xml as needed, like this:

<servlet>
<servlet-name>dispatch</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>dispatch</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

It is a bit of a hack, but works nicely. I have also used this in
conjunction with the CGIServlet class from the std Tomcat distribution
to run Ruby and Perl CGI scripts in hosted mode.

Rob

archer

unread,
Mar 17, 2007, 5:32:29 AM3/17/07
to gwt-sl
Great post. I've fixed it.
I'm not is that really needed to change mapping for "shell" servlet
from /* to /shell/*. I leaved it default - mapped to /*. And it works.
Thanks for your help.

> On 3/16/07, George Georgovassilis <g.georgovassi...@gmail.com> wrote:
>
> > Hello archer
>
> > When you say 'hosted mode' you are referring to both the hosted mode browser
> > and the tomcat it starts? In this case, you cannot use the GWTHandler
> > because it is started through a DispatcherServlet while GWT insists on
> > exposing it's own GWTShell servlet. You can use the hosted mode browser
> > though with an external webserver by using the -noserver argument on it, you
> > can read up the GWT FAQ on how to do this.
>

archer

unread,
Mar 19, 2007, 9:14:36 AM3/19/07
to gwt-sl
For sure, it works nicely without re-mapping Shell servlet form
default /* to /shell/*. Probably your project had some other
dependencies or requirements. However, I guess it must work with
default /* without any problems.

On Mar 16, 3:36 pm, "Robert Hanson" <iamroberthan...@gmail.com> wrote:

> > In this case, you cannot use the GWTHandler
> > because it is started through a DispatcherServlet
> > while GWT insists on exposing it's own GWTShell servlet.
>
> What I have done in the past, for various reasons, is to change the
> mapping for the GWTShell servlet.
>

> I, edit tomcat/webapps/ROOT/WEB-INF/web.xml, changing the shell mapping to this:


>
> <servlet-mapping>
> <servlet-name>shell</servlet-name>
> <url-pattern>/shell/*</url-pattern>
> </servlet-mapping>
>
> Then I change the arguments for the launch script to what you see
> below, adding "shell/" to the beginning of the HTML file path.
>
> -out www shell/org.globix.crw.CRWClient/CRWClient.html
>
> Then I can add other mappings to the web.xml as needed, like this:
>
> <servlet>
> <servlet-name>dispatch</servlet-name>
> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>dispatch</servlet-name>
> <url-pattern>*.do</url-pattern>
> </servlet-mapping>
>
> It is a bit of a hack, but works nicely. I have also used this in
> conjunction with the CGIServlet class from the std Tomcat distribution
> to run Ruby and Perl CGI scripts in hosted mode.
>
> Rob
>

> On 3/16/07, George Georgovassilis <g.georgovassi...@gmail.com> wrote:
>
> > Hello archer
>
> > When you say 'hosted mode' you are referring to both the hosted mode browser
> > and the tomcat it starts? In this case, you cannot use the GWTHandler
> > because it is started through a DispatcherServlet while GWT insists on
> > exposing it's own GWTShell servlet. You can use the hosted mode browser
> > though with an external webserver by using the -noserver argument on it, you
> > can read up the GWT FAQ on how to do this.
>

Reply all
Reply to author
Forward
0 new messages