aspose file tools*
The moose likes Servlets and the fly likes Servlet to Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet to Applet" Watch "Servlet to Applet" New topic
Author

Servlet to Applet

Ravi Gupta
Ranch Hand

Joined: Jul 15, 2006
Posts: 38
Hi

I am trying to develop an application where the user enters some data on a JSP page, the JSP then sends this data to a servlet, the servlet processes this data and sends this data to an applet so that the applet can draw a graph based on that data. I am not able to pass the data from servlet to applet. Please help.


help your PC help you best
http://simplepccare.spaces.live.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42932
    
  68
What does "I am not able" mean? How are you trying to do it?

The normal way of passing data to an applet would be to use <param> tags inside of the <applet> tag.
Chandan Ghosh
Greenhorn

Joined: Jun 13, 2005
Posts: 21
Hi,

This case, you have to use the Java Network APIs...
Use URL & URLConnection to call a servlet and read from servlet's output...
---------------------------------------------------------------------
String url = "http://www.abc.com/servlet/TestServlet?Name=Chandan";
URL testServlet = new URL( url );
URLConnection servletConnection = testServlet.openConnection();
inputStreamFromServlet = servletConnection.getInputStream();

// Now read the input from the servlet.
. . .
----------------------------------------------------------------------


Thanks & Regards,<br />Chandan Ghosh<br />SCJP1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet to Applet