Urgent !! Applet Servlet Communication


Web tier: servlets, JSP, Web frameworks: Urgent !! Applet Servlet Communication

  1. Urgent !! Applet Servlet Communication (2 messages)

    Consider a frame page with an applet that contains a JTree and the other page is a normal HTML form page. Now if a user enters some data on the normal html page and submits it(to a servlet) how can that be reflected on the applet. In case of JTree add a node. From an applet we first have to make the connection to the servlet and then the servlet can do some processing and then the data can be send back. BUT how is it possible to do some processing in a servlet(called from an HTML page) and then send the response back to an applet.
    Applet communicates with servlet with URL and URLConneciton classes. A user enters some data in the HTML page and that data is saved in the database, at the same time I have to refresh the JTree. That is after the servlet has done some processing it should communicate back to the applet and tell it that the processing is done. How can I do that.
    Applet to Servlet can be done BUT how can a servelt talks to Applet.
    Any help will be highly appreciated.
  2. U can use JavaScript to solve this problem. The servlet can embed the info it needs to send to the applet in JavaScript in its response. JavaScript can communicate the info to the applet. U can use the Observer pattern for more flexibility.

    Sachin Garg
    EHPT India
  3. Hi Sachin
     Thanks for yr reply. Can u give me some example or any links to websites.