Solved

refresh a page using jsp

Posted on 2004-08-18
4
881 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility

Thanks :)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now