Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

fetch URL from java

 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • 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
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Uh. HttpServletRequest#getParameter()?
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!