Web tier: servlets, JSP, Web frameworks: applet-servlet communication with persistent connection?
In my application(applet-servlet) I am using Http connection to communicate between applet & servlet
- Posted by: krishna kishore
- Posted on: April 16 2004 10:23 EDT
(object based) & I have to open and close the connection for every request.
Is there any way to re-use the http connection without closing the connection & Is it possible to maintain session
in this applet-servlet communication.
thanks in advance
- applet-servlet communication with persistent connection? by Mircea Crisan on April 16 2004 11:31 EDT
- applet-servlet communication by Paulo Benfatti on April 29 2004 08:38 EDT
- Applet Servlet Communication by Mohamed Sayed Ahmed on May 05 2004 04:58 EDT
The answer is: yes, you can mainiant the connection open. But I would not recommend this because mainianing an open connection for every client might need a many resources on yur server. I imagine that you want to keep the connection open so that the server could notify the client about some events. A simmillar behaviour can be obtained by periodically polling the server for new events.
Best regards, Mircea
thanks Mircea Crisan
I want to use persistent connection only because
the no. of Users of my application are less & number of
request's by each User are more, so how can I use a
persistent between applet & servlet, please help
me in this regard
thanks in advance
I also need to make a connection to communicate between applet & servlet.
Can you send me some source code about how you are doing this communication?
Tks in adv,
In My Application , i need to open a connection between Applet And Servlet using URlConnection
So in the Applet when the user press on the button , i want just to open a coonection with the servlet which just print ant statement , by using the following code
private void Send_actionPerformed(ActionEvent e)
URL url_base = getCodeBase();
String strHost = url_base.getHost();
String strPath = url_base.getPath();
int inPort = url_base.getPort();
URL ServletURL = new URL("http://"+strHost+":"+inPort+strPath+"servlet/ServletServer");
URLConnection conn = ServletURL.openConnection();
OutputStream out = conn.getOutputStream();
ObjectOutputStream objOut = new ObjectOutputStream(out);
objOut.writeObject(new String("Just Test"));
so when i execute the prev code no action happen in the servlet , i print the url and it return the right servlet url but i don't know why the servlet didn't response so please help me