Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting database values on loading first jsp page

 
renu sogi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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...
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • 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:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic