javapage-refreshbrowser-refresh

Java code to refresh browser


Whenever a user logs in(into an app which I've been working on), he will be redirected to his home page, which needs to be refreshed one time. I have to write the code in .java file to basically refresh the browser.

How can this be achieved with java. I know it can be done using javascript, but I have to achieve the above in a .java file. Any ideas ???


Solution

  • Just use code like this:

    response.setHeader("Refresh", "0; URL=http://your-current-page");