Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-09-09
9
Medium Priority
?
408 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 500 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

886 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