Hi all I'm really new about GWT and GXT. At this moment i developed a
little application that show data in a row. My idea is to export data
in some different format using this procedure:
1. With a button ask to a servlet to do job;
2. Doing extraction and manipulation;
3. Creation of file (XML, CSV, EXCEL, etc., ....) on server side;
4. Sending back file to client.
At this moment i try to develop a plain Java Servlet, like this one:
public class TestServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse
resp)
throws ServletException, IOException {
// TODO Auto-generated method stub
super.doGet(req, resp);
}
}
that implements POST method. This class is stored in server package of
my GWT project.
Now begins my problems. I'm not sure that is possible to do this....
I register my servlet in application.gwt.xml ihn this way:
<servlet class="..........server.TestServlet" path="/test"/>
and in web.xml i add:
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>..........server.TestServle</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
Using example proposed with GWT documentation I tried to make a HTTP
Request like this one:
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
URL.encode("test?id=123"));
try {
Request request = builder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
// Couldn't connect to server (could be timeout, SOP violation,
etc.)
}
public void onResponseReceived(Request request, Response response)
{
if (200 == response.getStatusCode()) {
// Process the response in response.getText()
} else {
// Handle the error. Can get the status text from
response.getStatusText()
}
}
});
} catch (RequestException e) {
// Couldn't connect to server
}
Running this code in hosted mode and check response i receive code
HTTP 405 that say to me that methos is not able to do operation.
Maybe is SOP.
My question is there a procedure to allow client to get file from
server using a procedure that display prompt for open or save?
Thanks for help.
mannobug
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---