Is there anything wrong in calling the applet's function from the servlet to deliver the data?
===

I earlier asked the question ,_"How can I make Servlet send some data to the applet ?"_

[~Link here](http://stackoverflow.com/questions/11648577/sending-data-from-a-servlet-to-applet-how-can-i-implement-this)

The responses I got were , to convert that data to _common transfer format_ for example xml,csv or use serialization. An advantage that was listed :

_Those common transfer formats have the advantage that there are so many APIs/libraries available to convert between a complex Java object and a String or input/output stream in the common transfer format with a minimum of needed code. Finally you just write it to the output stream of the HTTP servlet response which will then be retrieved as input stream of the URL connection in the applet._

Because nobody mentioned that,I need to ask : **_Can't I make a call to the applet's function from the servlet that contains the data,and deliver the data to that applet ?_**

Are there any drawbacks with this ?

This is what I am doing right know :_(I directly call the applet's function 'func')_

    // Snippet from the servlet

    gdfd = new GetDataFromDatabase(queryString);
    map = gdfd.getResult(); // Get the HashMap object from the bean
    new PollForm().func(map); // Send the map object to the applet