Solved

How can I change the html parameters for next auto-refresh

Posted on 2004-09-09
9
384 Views
Last Modified: 2011-10-03
The setting is a jsp page, call it graph.jsp, that resides in the Iframe of a parent jsp page. When certain buttons are clicked in graph.jsp, I execute a javascript function that tells the parent jsp page to reload the iframe with the same jsp page, graph.jsp, but with a different set of parameters. Now, graph.jsp is also coded to refresh itself every 15 seconds to display an updated graph. My problem is, when graph.jsp refreshes automatically, I don't want one of the parameters.  When I click a button, I call on the javascript function to refresh graph.jsp and I do want this parameter.

My question is, when an html page executes with parameters in its url, can I remove or define differently one of those parameters, so that the next time the page auto-refreshes, I  either don't have that parameter to worry about, or it is defined to a value that I know to ignore.  To read a parameter I use request.getParameter(name). Is there a function such as request.setParameter(name, value) or request.removeParameter(name)? I think that would do the trick.

0
Comment
Question by:arob42
9 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 12019394
show us the code you are using to refresh the pages.  is it javascript?  meta tags?

if you are doing this:

   setTimeout("self.location.reload()",15000);

then you can instead do this:

   setTimeout("self.location='http://yourserver.com/graph.jsp',15000);
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 125 total points
ID: 12019401
oops, missing "

setTimeout("self.location='http://yourserver.com/graph.jsp'",15000);
0
 

Author Comment

by:arob42
ID: 12019931
I've been using <meta http-equiv=Refresh content="15"> but will try your suggestion this afternoon. Thanks!
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 33

Expert Comment

by:knightEknight
ID: 12019992
do this instead:

<meta http-equiv=Refresh content="15, http://www.yourserver.com/graph.jsp" >
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12020029
oops,

<meta http-equiv=Refresh content="15, url=http://www.yourserver.com/graph.jsp" >
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12020037
doh!  still got it wrong ... should be a ; instead of a ,

<meta http-equiv=Refresh content="15; url=http://www.yourserver.com/graph.jsp" >
0
 
LVL 2

Expert Comment

by:Peepsalot
ID: 12030261
if you are wanting to continue passing some parameters, but not others, then I would use server side scripting to create a querystring, and place that querystring in either the javascript reload, or http meta refresh.

Not sure about jsp, but in asp it would look something like:

<meta http-equiv=Refresh content="15; url=http://www.yourserver.com/graph.jsp?param1=<%=Request("param1")%>&param2=<%=Request("param2")%>">

That way you can specify exactly which parameters to carry over, so if param3 is the one you do not want to include, you simply do not place it in the new querystring.

Hope that helps
0
 
LVL 11

Expert Comment

by:raj3060
ID: 12044057
There is
request.setAttribute("name",name);
request.removeAttribute("name");
If that helps.
--Raj
0
 

Author Comment

by:arob42
ID: 12071799
Thanks for all the help.  I ended up using this

  <body onload="setTimeout('changePlot(null)',15000);">

where changePlot() is a javascript function that refreshes the iframe with different parameters depending on what the argument is set to.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

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