?
Solved

refresh a page using jsp

Posted on 2004-08-18
4
Medium Priority
?
895 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Introducing Priority Question, our latest feature.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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