Thanks u so much Farman for your code.
And, now I want to ask, how to set the time out for servlet.
tx.
br,
yoel.
> -----Original Message-----
> From: Farman Khan [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 11, 2000 9:21 PM
> To: [EMAIL PROTECTED]
> Subject: Re: How to read a URL content from servlet ???
>
> Here is the code to read URL content in the servlet:
> ---------------------------------------------------------------
> public StringBuffer toHtml(String urlFileName, PersistentData
> persistentData, TransientData transientData) {
>
> String imagesPath = "/" + mainDir + resourcesDir;
> StringBuffer sb = new StringBuffer();
>
> String pUrl = new String();
> if (persistentData != null) {
> pUrl = persistentData.getPartialURL();
> }
>
> try {
> URL url = new URL(pUrl + mainDir + htmlDir + urlFileName);
> BufferedReader in = new BufferedReader(
> new InputStreamReader(url.openStream()));
>
> String str;
> while ((str = in.readLine()) != null) {
> sb.append(str + "\n");
> }
> in.close();
> } catch (MalformedURLException e) {
> } catch (IOException e) {
> }
>
> return sb;
> }
> --------------------------------------------------------------------------
> --
> ---
> Farman
>
> -----Original Message-----
> From: Yulyanto (CIS, Group-HO) [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 11, 2000 3:57 AM
> To: [EMAIL PROTECTED]
> Subject: Re: How to read a URL content from servlet ???
>
>
> What i wanna do is read the content of URL page using
> servlet..........
> not read the parameter request from client.
>
> tx.
> yoel.
> > -----Original Message-----
> > From: N. Zulfikhar Ali [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, April 11, 2000 11:36 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: How to read a URL content from servlet ???
> >
> > use the following method
> >
> > HttpUtils.getRequestURL(req);
> > or
> > HttpServletRequest.getRequestURI();
> >
> >
> >
> >
> > "Yulyanto (CIS, Group-HO)" wrote:
> >
> > > Hi all,
> > > I wanna know how to read content of a URL from servlet ???
> > >
> > > tx.
> > >
> > > br
> > > yoel.
> > >
> > >
> >
> __________________________________________________________________________
> > _
> > > 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
>
> __________________________________________________________________________
> _
> 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
___________________________________________________________________________
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