• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Amit Roy
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic