On Mar 25, 2:58 am, Thomas Broyer <[email protected]> wrote:
> 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 accesshttp://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.
If you want to test the servlet in hosted mode you'd need to map the
pattern "/exportExcel" to ExportExcelServlet.
There's a way in GWT 1.5, throug the file "/tomcat/webapps/ROOT/WEB-
INF/web.xml".
In GWT 1.6 it's easier, you can place it in "/war/WEB-INF/web.xml".
In this way you can open a new window with the excel file (or a open/
save dialog), debug inside the code in hosted mode, ...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---