Solved

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

Posted on 2004-09-09
9
395 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
[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
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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

705 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