By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,301 Members | 807 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,301 IT Pros & Developers. It's quick & easy.

Auto Refresh page

P: 2
Hi,

I need to auto refresh a page after a specific time interval. When the page is accessed the first time, a request parameter is null and hence it gets redirected to a welcome page (static html). When user clicks on a link from the left menu, i take the ID passed during the click and the page is redirected to a jsp that has information specific to that ID. Now, when i write a script to refresh this page (with some info), the ID is lost and hence the user is taken to the welcome page (static html).

I tried using the <meta > tag for refresh, but facing the same issue. I have also tried the window.location.replace and window.location.href in the script but both throw a alert message when the page refreshes ("you are transferring info ...blah...blah...Retry ? Cancel"). I need to avoid this. I need help in this regard.

thanks,
tinu
May 3 '07 #1
Share this Question
Share on Google+
3 Replies

acoder
Expert Mod 15k+
P: 16,027
The meta refresh should work (I think).

Post your code.
May 3 '07 #2

P: 3
The meta refresh should work (I think).

Post your code.
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<f:loadBundle basename="messages" var="msg" />
<LINK rel="stylesheet" type="text/css"
href="../theme/DashBoardStyle.css" title="Style">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="refresh" content="3">
<f:verbatim>
<title>Welcome</title>
</f:verbatim>

<f:verbatim>
<table align="left" border="0" width="100%" cellpadding="0" cellspacing="0">

</f:verbatim>
<h:form id="welcomeOne">
<f:verbatim>
<tr>



<td width="75%" style="margin-left: 10px" align="center">
<table width="100%" border="0">
<tr align="left" valign="top">
<td align="left">
</f:verbatim>
<%
String dashboardId = request.getParameter("dashBoardID");
String path = null;

if(dashboardId == null) {

%>
<f:subview id="dashboard_included_page">
<jsp:include page="welcome.jsp" flush="true"/>
</f:subview>
<%
} else {
com.proj.ApplicationProperties properties = new com.proj.ApplicationProperties(com.proj.CommonCons tants.APPLICATION_PROPERTIES);
String URL = properties.getProperty(com.proj.CommonConstants.DA SHBOARD_URL);

%>
<f:verbatim>
<iframe src ="<%= URL %><%=(String) request.getParameter("dashBoardID")%>"
marginwidth="100px" height="1000" frameborder="0" scrolling="auto" width="100%">
</iframe>
<input type="hidden" name="dashBoardID" value="<%= request.getParameter("dashBoardID")%>" />
</f:verbatim>
<%
}
%>
<f:verbatim>
</td>
</tr>
</table>
</td>
</tr>
</f:verbatim>



<f:verbatim>


<tr>
<td height="20"></td>
</tr>
</f:verbatim>
</h:form>
<f:verbatim>
</table>
</f:verbatim>[/HTML]
May 4 '07 #3

acoder
Expert Mod 15k+
P: 16,027
You can also use
Expand|Select|Wrap|Line Numbers
  1. window.location.reload();
May 4 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.