We help IT Professionals succeed at work.

how to get the content output from another servlet?

nphnhi asked
Last Modified: 2013-11-24
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
Watch Question

You should to forward the request to the the second servlet once the first servlet is done with its processing.


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(

      String inputLine;

      while ((inputLine = in.readLine()) != null)

This one is on us!
(Get your first solution completely free - no credit card required)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.