• Post Reply Bookmark Topic Watch Topic
  • New Topic

search an element in arraylist and display in jsp page  RSS feed

 
for java
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

Can anyone help how to take input from user from a jsp page to search for a substing in arraylist in java class and display the list in jsp page

i trying to work with a jsp page and servlet

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your code? What specific problems are you having with it?
 
bharat salunkhe
Greenhorn
Posts: 25
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for java wrote:Hello

Can anyone help how to take input from user from a jsp page to search for a substing in arraylist in java class and display the list in jsp page

i trying to work with a jsp page and servlet

Thanks


take input from jsp in servlet using request.getParameter("your textbox name");
and use iterator for serch your string in list
and for print you can use something like this

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bharat salunkhe wrote:and for print you can use something like this ..

That's an incredibly bad practice. First, there should be no Java code in a JSP. Second, the whole point of a JSP is to serve as a template for HTML so that you don't have to use strings containing the HTML markup.

Do not follow this advice.

To learn what JSP is all about, please read this article.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!