i have a problem with gwt application. i have an array of strings in the c开发者_JAVA技巧lient application and i want to export it to a file, but it isn't probably possible so i have to use servlet, right? but i don't really know how.
It is quite unfortunate, given the advance of browser applications, that data produced by such applications cannot be saved by the user locally, but instead has to make e round trip to the server. It would be really helpful, I think, to adopt the data scheme (http://en.wikipedia.org/wiki/Data_URI_scheme) for such cases, and not only for images, which has proved itself quote useful. If this scheme is adopted a GWT app could build a link and provide the data to be saved as part of the href attribute of the tag.
Here's a guide on How to Call a Servlet in GWT.
Alternatively, use the GWT HTTP client to send a GET or POST request to the servlet.
In this case using servlet is a good idea or maybe RPC is better. What do you think? So far I wrote a separate servlet that writes an array of strings to a file. But I don't know how to connect to the gwt project. Will this created file be HttpServletResponse response in this case?
精彩评论