• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Put the result in the same page

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i have a jsp page very simple, that have a form with a text field and a submit button, above are the code :





As you can see i have a action named "dasaldo" that is the name of my servlet, above are the servlet code :



Everything works fone, and when a put the name of client and press submit,
the app print in System.out.println the resultset fine.

the problem is that i want to put the resultSet in the page and not in System.out.println
what can i do to put the result of query in the same JSP that have the text field and the submit button ?

best regards
 
Ranch Hand
Posts: 119
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

The option is that you can create a pojo that contains each row of data from the result set object. This pojo in turn need to be placed in some collection, for instance in an array list. Next put this collection in the request object attribute and redirect the response to the same jsp page.

In the jsp page you can check if the attribute is exists, get the list from there. Using a standard tag lib and an EL you can iterate it and display it on your jsp page.
reply
    Bookmark Topic Watch Topic
  • New Topic