refresh a page using jsp

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

Question by:OsdNA
LVL 92

Expert Comment

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

Accepted Solution

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" );

Expert Comment

ID: 11897077

<meta http-equiv="refresh" content="10; URL=">



Java Script


good luck

Author Comment

ID: 12198844

Thanks :)

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Export JSON response data to Excel in IE9 3 74
JSP Popup page 2 115
Coldfusion 10 - JSP File Not Found - 404 Error 5 92
SimpleDateFormat.parse examples 19 93
When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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