Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

auto refresh and recalling servlet auomaticallty

 
s. anitha
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

my jsp page having like this


<img src="/Chartservlet">

i want to auto refresh this page. in the meanwhile i want to call the servlet to display the image. the servlet response as image.pa help me. i want to aurto refresh the page for every minute.


Anitha

 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use the meta tag or the header to refresh the page automatically.

1)<META HTTP-EQUIV="refresh" content="60">
2)response.setHeader("refresh","60");
 
s. anitha
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
thanks sri

ur code is working. it refreshes my page. but i want to call my servlet which i specified in img src should me re execute.what shall i do.

i want to execute my servlet automatically for each minute


plz help me.

Anitha

 
Sripathi Krishnamurthy
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check the way ChartServlet is called. If the servlet is in proper path, it should be invoked when the page is refreshed.

For more information refer to a sample application(below URL)

http://www.servletsuite.com/servlets/banner.htm
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should ensure that the url of your page maps to the servlet. For example if your url is <your_context>/somepage, you should map the path 'somepage' to the servlet that you wish to execute and process the request. The mapping is defined in web.xml. The same's true for jsps too.

ram.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic