Solved

refresh a page using jsp

Posted on 2004-08-18
4
886 Views
Last Modified: 2008-03-10
Is it possible to refresh a page using jsp?, or embed a html refresh within jsp?


0
Comment
Question by:OsdNA
4 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11837510
sure, a jsp outputs html so just add the html that you need to your page.
0
 
LVL 1

Accepted Solution

by:
DS_CL earned 50 total points
ID: 11837515
Yes.  There are many ways to do this.  It depends on what you mean by refresh the page.  Here are two examples to refresh a page, the first uses jsp to embed a meta tag to refresh the page continually.  The second uses the jsp header to refresh the page every time a user clicks the refresh button.

- Using jsp to create HTML meta tags (
<%
out.println("<meta http-equiv=\"refresh\" content=\"1\"/>")
out.println("<meta http-equiv=\"expires\" content=\"0\" />")
%>

- Removing cache so page always reloads
<%
response.setHeader( "Expires", "Tue, 19 August 2003 12:00:00 GMT" );
response.setHeader( "Cache-Control", "no-store, no-cache, must-revalidate" );
response.addHeader( "Cache-Control", "post-check=0, pre-check=0" );
response.setHeader( "Pragma", "no-cache" );
%>
0
 

Expert Comment

by:iglez
ID: 11897077
Html

<meta http-equiv="refresh" content="10; URL=http://url.com">

JSP

response.sendRedirect("URL");

Java Script

setTimeout("location.href='URL'",10000)

good luck
0
 

Author Comment

by:OsdNA
ID: 12198844

Thanks :)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question