Solved

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

Posted on 2004-09-09
9
379 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
Comment Utility
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
Comment Utility
oops, missing "

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

Author Comment

by:arob42
Comment Utility
I've been using <meta http-equiv=Refresh content="15"> but will try your suggestion this afternoon. Thanks!
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
do this instead:

<meta http-equiv=Refresh content="15, http://www.yourserver.com/graph.jsp" >
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
oops,

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

Expert Comment

by:knightEknight
Comment Utility
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
Comment Utility
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
Comment Utility
There is
request.setAttribute("name",name);
request.removeAttribute("name");
If that helps.
--Raj
0
 

Author Comment

by:arob42
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

772 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

12 Experts available now in Live!

Get 1:1 Help Now