This week's giveaway is in the Testing forum.
We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line!
See this thread for details.
Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

fetch URL from java

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ranchers,

I have written java code which is having two threads and that forms two URLs with different IPs on two different servers but same application.
I have used java.net.URL package, now the question is how would I fetch the URL as well as parameters along with it in jsp page.

thanks
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The whole question is vague. Please elaborate with proper terms.

You want to display the output of two external webpages in a single JSP page or so? If so, use JSTL's c:import tag. Passing parameters can just happen the usual query string way.
 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...
.....
.....
class threading{
....
...

public void run(){
String url=null;
url="http://"+ip+"/myjsp.jsp?start="+start+"&end="+end;
try {
new URL(url);
System.out.println("url"+url);
} catch (MalformedURLException e) {
....
}
now when login.jsp page gets hit on the localhost it will call the method from the java file which executes the thread part
and generates two URLs with two different IPs and the same application.

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
*Raises eyebrows and blinks eyes.

Sorry, I don't understand the actual problem.
Please ask questions the smart way.
 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
forget it

read this
one computer will generate two threads and sends two parameters appended to a URL
the other two system will get the values "first" and "last".
and based on the values it will further proceed.
the java file creates URL and threads will be the part of the program.
so the question is how will i get these two values sent by the java program to jsp pages on different machines but both the machines are having same application/page

thanks
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Uh. HttpServletRequest#getParameter()?
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic