• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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()?
 
reply
    Bookmark Topic Watch Topic
  • New Topic