Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending response

 
Sree kanth
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

How do i send an httpservletresponse to a client or to all the clients of my servlet without a resonse from the client. I am using J2EE servler.

please help me

Sree
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sree kanth:
hi all

How do i send an httpservletresponse to a client or to all the clients of my servlet without a resonse from the client. I am using J2EE servler.

please help me

Sree


Do u mean without a request to your serlvet?

-Praful
 
Sree kanth
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh yes.
The client has already logged in. now what i want is without the client refreshing the browser,response is to be sent to him
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.

HTTP is a stateless protocol. The server doesn't know the clients exist until they make a request. Then, after the response is sent, it forgets they exist.
 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the Meta tag can be used.

<META HTTP-EQUIV="REFRESH" CONTENT="60;URL=anypage.jsp">

This is equivalent on clicking "Reload" button and will create a new Get request.

This tag will reload the page every 60 seconds. replace 60 with any number of your choice(in seconds).
[ March 14, 2005: Message edited by: Sripathi K S ]
 
Sree kanth
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much
 
Raja gopal Y
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srikanth,

Is the META tag Working for you, for me it's not.

Regds
Rajagopal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic