I know that the example builds a string containing html and opens the
html with excel. But in the jsp app of my collegue it looks okay.
Your approach seems to point me into the right direction. I'm using
gwt-ext and the data which I want to export to Excel is already
available in the frontend. That's why I'm searching for a way to put
this data in some kind of format and open it with Excel. I didn't find
a way to achieve this directly on client-side. That's why I thought I
pass it to the server which sends a response of the same data with the
different content-type set.

Thanks for your help. I will try your approach with the iframe

On 17 Nov., 16:07, Lothar Kimmeringer <[EMAIL PROTECTED]> wrote:
> woody schrieb:
>
> > The stachtrace looks like this:
> > javax.servlet.ServletException: Content-Length must be specified
> >    at com.google.gwt.user.server.rpc.RPCServletUtils.readContentAsUtf8
> > (RPCServletUtils.java:131)
> >    at com.google.gwt.user.server.rpc.RemoteServiceServlet.readContent
> > (RemoteServiceServlet.java:335)
> >    at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
> > (RemoteServiceServlet.java:77)
>
> It looks like there is the RemoteServiceServlet being called by
> the RequestBuilder. That can't work you have to call the original
> servlet or do that inside a RemoteServiceServlet and pass the data
> through. BTW:
>
>       response.setContentType("application/ms-excel");
>       response.setContentLength(8100);
>
>       PrintWriter out = response.getWriter();
>
>       String htmlString = new String("<HTML>" +
>               "<TABLE cellspacing=1 cellpadding=1 border=1> " +
>
> This is not an Excel-format.
>
> > I just ask myself if I I did choose the wrong way. Is it possible to
> > call simple servlets from GWT? I always read about RPC and
> > XMLHttpRequest.
>
> My favorite way is define an Iframe on the base-page of the
> GWT-application that I access inside the java-class and set
> the source of the iframe using DOM. That way you can call
> the servlet directly and the browser should behave the same
> way like you're used to in the good old JSP-times.
>
> Regards, Lothar
--~--~---------~--~----~------------~-------~--~----~
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