Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

is there any way to make servlet getting execute without sending request  RSS feed

 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear JavaRanchers,

i have an application in which i want to send the message to the user by continuously looking the DB table .
if flag value is N then it has to send the message for this requirement what i have to do that make a servlet or jsp running continuously to the messages if the flag value is N

any help will be appreciated
Regards
Rambabu
 
E Armitage
Rancher
Posts: 989
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read up on AJAX
 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E Armitage wrote:Read up on AJAX


Dear RanchHand,
Can you explain elaborately

Regards
Rambabu
 
sailaja usha
Greenhorn
Posts: 13
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to read AJAX, Asynchronous JavaScript and XML which helps you to accomplish your task
 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sailaja usha wrote:Try to read AJAX, Asynchronous JavaScript and XML which helps you to accomplish your task


if you do not mind , explain clearly

Regards
Ram
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not clear about your question explanation. but to your subject line:

is there any way to make servlet getting execute without sending request

you can look for load-on-startup in web.xml.
 
Sumit Patil
Ranch Hand
Posts: 296
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if you do not mind , explain clearly

Go through this AJAX tutorial
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:I am not clear about your question explanation. but to your subject line:
you can look for load-on-startup in web.xml.


This is what was taught in some books some time ago but you should really be using a ServletContextListener for code at startup. Servlets should be used only to serve requests.

@OP, it's unlikely that someone is going to explain all about AJAX for you in this thread since there are tons of pages online already written on the subject.
You should Google and read about AJAX then probably find an AJAX library that makes it easy to use in your application.
 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:I am not clear about your question explanation. but to your subject line:

is there any way to make servlet getting execute without sending request

you can look for load-on-startup in web.xml.



Dear Bartender,

In my application a SMSjsp or SMSservlet which is continuously looking for DB table like SMS_DEMAND in which if it has a flag IS_SMS value N then that jsp or Servlet send the SMS to the particular user.
this process is taking place continuously for every five minutes.
for this purpose ,is there any way to getting execute that SMSservlet or SMSjsp itself for every five minites.

Regards
Ram
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Short Answer - NO

Servlets and JSP are designed around the request-response cycle which must be initiated by the client side.

Various tricks such as Comet and AJAX may make it appear like the servlet/jsp side is sending a response without a request but there is always a request to start.

Bill
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can set refresh header. but I do suggest you to look for a scheduler like quartz!
 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Short Answer - NO

Servlets and JSP are designed around the request-response cycle which must be initiated by the client side.

Various tricks such as Comet and AJAX may make it appear like the servlet/jsp side is sending a response without a request but there is always a request to start.

Bill


thank you
 
rambabu desina
Ranch Hand
Posts: 42
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:you can set refresh header. but I do suggest you to look for a scheduler like quartz!


thank you
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!