tags:

views:

50

answers:

3

Can anyone help me? I want to create a search button that will search a word in more than one text file stored on the disk and want to dispaly the corresponding text file in a jsp page.

A: 

I recommend Head First Servlets and JSP for an introduction to Java Web programming. If you think you understand how servlets and JSPs work, but you are having a specific difficulty, let us know what you have tried.

FarmBoy
I know how to create jsp page. I have created the page with a search button and a textfiled and a textarea now I want that when I enter a word in that textfield and click on search button the textfile containing that word should be displayed in that textarea..I hope U understood the situation...
gargee
A: 

You culd try this tutorial about Lucene (a java search engine api) http://www.devx.com/Java/Article/27728/0/page/3

cerealk
A: 

I am not getting how can I search a word in the textfiles stored in one folder and display that textfile content in textarea... :(

Use the BufferedReader or Scanner methods in combination with String methods.

This problem is by the way unrelated to JSP. It's more related to basic Java IO and String fundamentals. You would have exactly the same problem when doing so in a normal Java class (which you should actually be using after all). Once you've finished this task, then integrate it in your webapplication by just importing and calling it from inside your Servlet code which your JSP form should be submitting to.

Here are some tutorials of relevance:

BalusC