On 24 mar, 21:53, vroom_vroom <[email protected]> wrote:
> Surprizingly, keeping all code the same with the exception of the
> client side...and changing all that code to just:
> Window.open("/exportExcel", "_self", "");
>
> actually works.

Your RequestBuilder in the previous code snippet would create an
"ajax" connection from your browser where the response from the server
is accessible in the Response's getText(). That's the whole point of
AJAX: handling the response from code. This means that this never,
ever pops up a "save to disk" dialog (which is the desired behavior).

> However, in hosted mode even though the file is created and my servlet
> is hit I get the error:
> [ERROR] Unable to find 'exportExcel.gwt.xml' on your classpath; could
> be a typo, or maybe you forgot to include a classpath entry for
> source?
>
> So not sure why this error occurs...maybe I am doing my servlet
> mapping incorrectly?? Should it not go in the projects .gwt.xml file?
> I am speaking of the same file that you inherit the other modules and
> gwt style sheets.

In hosted mode, the servlet declared in your module lives within your
module (e.g. http://localhost:8888/my.package.MyModule/exportExcel),
while "/exportExcel" above tries to access http://localhost:8888/exportExcel
which the hosted mode tries to resolve into a module named
"exportExcel" (hence the look-up for a exportExcel.gwt.xml).
The solution (which is documented) is to use GWT.getModuleBaseURL() +
"exportExcel" which will resolve to "/my.package.MyModule/" in the
hosted mode, and probably just "/" when deployed as your ROOT webapp.
--~--~---------~--~----~------------~-------~--~----~
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