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

auto refresh and recalling servlet auomaticallty

s. anitha
Greenhorn

Joined: Jan 18, 2005
Posts: 18
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

Joined: Mar 07, 2005
Posts: 232
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

Joined: Jan 18, 2005
Posts: 18
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

Joined: Mar 07, 2005
Posts: 232
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

Joined: Jan 24, 2005
Posts: 489

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.
 
Consider Paul's rocket mass heater.
 
subject: auto refresh and recalling servlet auomaticallty