Shruti Gudagur
Shruti Gudagur

Reputation: 3

how to refresh web page using java code?

I am creating a web page for an application and I need to refresh the page to see the changes. how can I do it using Java or even ant script will do??

Thanks in advance

Upvotes: 0

Views: 7103

Answers (1)

Killer
Killer

Reputation: 590

If you use Servlet, in your service method use code like this.

          response.setHeader("Refresh", "10; URL=http://localhost:9090/J2EE_Exercise/index.html");

It will refresh my page in 10 seconds, and redirect it in "index.html" page which is the index page of my project named "J2EE_Exercise".

Upvotes: 1

Related Questions