String urlfich="http://eeee.dddd.com";
     URL urlfi=new URL(urlfich);
     InputStream fin = urlfi.openStream();
     InputStreamReader isr=new InputStreamReader(fin);
     BufferedReader br=new BufferedReader(isr);
     String linea=br.readLine();
    String pagecontent="";
     while (linea!=null) {
                pagecontent += linea;
    }

    This is the code to obtain the lines from an url and put them into a String;



-----Original Message-----
From: Jason Dimm <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, June 22, 1999 3:01 PM
Subject: URL and URLConnection Objects


>Hello all,
>
>Does anyone know how I can use the URL and URLConnection objects to connect to a
>website (say, www.yahoo.com), grab the html from their home page, and put it
>into a string within a servlet?
>
>Please send me any code samples you might have or can show me to get me started
>in the right direction (relatively new to Servlets).
>
>Thanks,
>
>Jason
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to