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
Java EE
Last Comment
Computer101
8/22/2022 - Mon
aman123_123
You should to forward the request to the the second servlet once the first servlet is done with its processing.
nphnhi
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(inputLine);