my dog learned polymorphism*
The moose likes Servlets and the fly likes Text Search on a file from a JSP page????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Text Search on a file from a JSP page?????" Watch "Text Search on a file from a JSP page?????" New topic
Author

Text Search on a file from a JSP page?????

Amit Roy
Ranch Hand

Joined: Oct 10, 2000
Posts: 132
hi
Is it possible to do a text search on a .doc or .pdf file using java using FileReader of BufferedReader actually what i want to do is to take a text from a textbox in a JSP page and then search a particular file using that text.So i need to put the text search code in my bean.
Amit Roy


<I>Chance Favours the Prepared minds"</I>
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,
remember that JSP is resolved on the server and sends only html to the browser, so if you want to do a text search on a .doc or .pdf that is hosted in the server you can use the io java classes, but if you want to do it at the client side you�re gonna have to use a signed applet to have acces the client files.
Amit Roy
Ranch Hand

Joined: Oct 10, 2000
Posts: 132
I want to do a search on a file that is there on the server bu i am not sure as to what IO classes and methods or classes i will have to use actually i was lookinf 4 a sample code or something to do it i tried Filr Reader and BufferedReader iy works fine with .txt files but not on .pdf and .doc files
Steve Lam
Greenhorn

Joined: Aug 03, 2001
Posts: 5
.pdf and .doc are binary files. Thus, you cannot do a text search on the files.
Sorry, but the java API does not include methods or classes to search text in binary files. You might be able to find a 3rd party solution, but I am not aware of any.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Text Search on a file from a JSP page?????
 
Similar Threads
How can I do a text search in a file
How to convert JSP into a txt or html file?
I want two buttons on a page, one for "search refine", one for "submit", how to do ?
creating a text file from JSP
Writing to a text file using servlet