• 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

Getting database values on loading first jsp page

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I am implementing small application called 'PhoneBook'. I got stuck at one small problem. When my first jsp page loads i want some database values to be retrieved and to be sent to same jsp page. I tried on my jsp page; where view.do will be mapped on controller method which will call dao class method which retrieves database values. and then controller sends this list to same jsp. Now what happening is when jsp receives the data from controller it again sends the request to controller; as it has and this is an infinite loop. My question is how to control this loop...
first jsp page


controller class



dao class





thanks in advance...
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well when someone navigates to view.do it looks like you are making your query populating a list with those entities and returning a view. In that view you have access to those objects you queried. There is no need to go and get them later.

do something like this:

 
reply
    Bookmark Topic Watch Topic
  • New Topic