send object to servlet

Hello.
I have vaadin application and servlet. At some moment vaadin application send some request to servlet. Servlet get it and send another object back to vaadin application. It looks like that:


    MyObj getMyObj(){
        String url = dataServerUrl + "?action=getMyObj";
        window.open(new ExternalResource(url));        
        //here I need to get answer from servlet
    } 

How can I do this?
Thank you.

If I understood you correctly, you have a REST-like API on another servlet, and want to use this in your Vaadin application. This is NOT a Vaadin feature, and Vaadin does not provide any methods for you to access these. The open()-call you are using sends a browser redirect to the vaadin client side, which is not what you are after here. You need to use a 3rd part library or the Java interfaces for making HTTP calls.