aspose file tools*
The moose likes Spring and the fly likes Getting database values on  loading  first jsp page  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Getting database values on  loading  first jsp page  " Watch "Getting database values on  loading  first jsp page  " New topic
Author

Getting database values on loading first jsp page

renu sogi
Greenhorn

Joined: Feb 06, 2012
Posts: 15
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

Joined: Mar 07, 2010
Posts: 1632
    
    7

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:



[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting database values on loading first jsp page
 
Similar Threads
Login Module for Online Test Application
exception while running code
request.getAttribute() returns null in the JSP page
How to process operation on check box here
Struts-2 Action class issue