954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Calling another dynamic URL in jsp

Hi All,

I am creating an application in which I want to keep refreshing a jsp file and in that jsp file i need to keep calling another url of type www.daniweb.com/receive.jsp?a=xxx&b=xxx and save this url in database. Here the url keeps changing in every second ie. values of a & b keeps changing.

I have been able to keep refreshing the jsp file but unable to call another dynamic url in it. Please tell me how to do it in my jsp.

Thanks in advance for your help.

meghab
Newbie Poster
5 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

MegHab,

You can do this one of two ways.

On each cycle :-compose the next page's URL in JSP and insert into a META REFRESH (Google search if you don't know what it is)
compose the next page's URL and go to it after 1 second (1000 milliseconds)in javascript :

onload = function() {
  var a = ......;//here write the rules for generating a
  var b = ......;//here write the rules for generating b
  setTimeout( function(){
    location.search = 'a=' + a + '&b=' + b;
  }, 1000 );
};


Please note: As written, the code won't give a 1 second cycle time. Rather, the page will reload 1 second after it has completely loaded, which is more likey what you want, though I must say it's a rather odd sort of application. I hope it's nothing sinister.

Airshow

Airshow
WiFi Lounge Lizard
Moderator
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: