THANK you all for helping me out.Now my search engine is working.
Thanks Nic and Brevsville Administrator.

Now my search engine is working but it displays all the results on the same
page.
Is there any way out using which i can limit the no. of results shown on a
page and
user can see other results by pressing NEXT(or any such thing).

thanks in advance.

waiting for reply...

Vinay

----- Original Message -----
From: Nic Ferrier <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 31, 2000 2:50 AM
Subject: Re: How to read a file on the server using Servlets?


> >>> Vinay Nath <[EMAIL PROTECTED]> 30-May-00 7:32:08 PM >>>
>
> >I m making a search engine using Servlets.For that i need
> >to read the html files from the server.
> >Can anyone tell me the easiest way to read a file from the
> >server.
> >Well I m using FileInputStream class but it throws
> >FileNotFoundException even when the file is there on the
> >server.
>
> This is probably a problem of naming.
>
> The easiest way to do it is to do this:
>
>    String file=getServletContext().getRealPath(webpath);
>    File f=new File(f);
>    FileInputStream fin=new FileInputStream(f);
>    ....
>
> But you can also do it using:
>    ServletContext.getResource(path);
>
> Both methods are well documented in the API docs. Check there for
> more details.
>
>
> Would you like to GPL your servlet when you've done it and have it
> released with the GNU-Paperclips servlet container? If so contact me
> privately.
>
>
>
> Nic Ferrier
>
>
___________________________________________________________________________
> 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