nphnhi
asked on
how to get the content output from another servlet?
Hello,
I have 2 servlets, one will test the connection, then using out.println(theresult).
Now, the second servlet will get theresult from the first servlet. How to do it?
Thank you very much
I have 2 servlets, one will test the connection, then using out.println(theresult).
Now, the second servlet will get theresult from the first servlet. How to do it?
Thank you very much
You should to forward the request to the the second servlet once the first servlet is done with its processing.
ASKER
i found the solution.
how to read directory from URL
import java.net.*;
import java.io.*;
public class URLReader {
public static void main(String[] args) throws Exception {
URL yahoo = new URL("http://www.yahoo.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(
yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLi ne);
in.close();
}
}
how to read directory from URL
import java.net.*;
import java.io.*;
public class URLReader {
public static void main(String[] args) throws Exception {
URL yahoo = new URL("http://www.yahoo.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(
yahoo.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLi
in.close();
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.