For various reasons, my application has to generate URLs for pages/
servlets/etc. in the same webapp (for things like images held in my
database and served by a servlet). It's incredibly annoying that, when
I'm debugging, I need to use a URL that looks like this:

http://127.0.0.1:8888/Report.html?gwt.codesvr=127.0.0.1:9997#1

and when I've deployed the application, the URL looks completely
different:

http://www.mysite.com/report/Report.html#1

This difference makes it very difficult to debug my application
without do a full deployment to the real server, and I *hate* to be
forced to deploy code that cannot be tested locally, first. I actually
don't mind that the server name/port is different, though even that is
annoying. The real problems are the "?gwt.conesvr" argument and the
lack of the the servlet-context name ("/report" in the above example)
in the debug-mode URL.

Because of these differences, generating URLs is an annoying, fragile,
and error-prone process. First, I have to detect that I'm running
under GWT (which isn't too bad --- I can just look for localhost or
equivalent) and then create special URLs for that situation (which is
hideously bad, since that code runs only when I'm testing, and
different code entirely runs when I'm deployed, and that code can't be
tested properly). The fragility comes from the fact that I had to
change all my if-in-hosted-mode-do-X code when GWT 2 came out, because
the URL structure had changed.

Ideally, I'd like:

1) a way to add a servlet-context (e.g., http:/127.0.0.1:8888/
myServletContext)  to a URL used in debug mode so that I can generate
a structurally-similar URL for both debugging and deployment. This
servlet-context part of the URL could simply be ignored by the debug-
mode web server. I'd be perfectly happy for reasonable restrictions to
be in place (e.g., you could use "/context" but not "/context/
subcontext"), or I could specify the context name in the module file
or some other reasonable place.

2) no extra garbage (such as "?gwt.codesvr..." added to the URLS.
Surly, this information can be passed to the debug-mode web server in
some other way.

If there's some sort of workaround for these problems, I'd love to
know about it. If there is no workaround, I consider this
inconsistency to be a serious bug in GWT.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to