Solved

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

Posted on 2004-09-09
9
391 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
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!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

763 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