tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Smith" <sat-g...@home.com>
Subject Re: JSP output redirection to a file.
Date Mon, 25 Dec 2000 20:47:50 GMT
Carvalho,

This is explained in detail in Sun's Java Tutorial,
the section on networking. You might want to read 
up about it.

The following is the basic idea:

...
URL url = new URL(http://www.yahoo.com/);
....

public String get() throws IOException {

 
  URLConnection urlCon = url.openConnection();
  BufferedReader in = new BufferedReader(
        new InputStreamReader(
        urlCon.getInputStream()));
  
 String inputLine = null;
 String result = "";

 while ((inputLine = in.readLine()) != null)
      result += inputLine + "\r\n";

 in.close();

 return result;
 
}

//end code.

This does a GET. You can POST on a site too, it is not much harder.

Dave
----- Original Message ----- 
From: "carvalho joao" <jngscarvalho@yahoo.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Monday, December 25, 2000 1:16 PM
Subject: JSP output redirection to a file.


> Hi, is it possible to redirect the output of a
> specific JSP or servlet to a file/buffer while the
> tomcat server is running.
> 
> Happy Cristmas!!
> Best Regards
> Joao Carvalho
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/


Mime
View raw message