This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes Where to keep values? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Where to keep values?" Watch "Where to keep values?" New topic
Author

Where to keep values?

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
If a JSP page contain Fields like Drop list, Combo box, Option button, etc. Those should be populated with value when it display to user. Where to save those values?, in data base or some other resource?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

That clearly depends upon the application. No one answer would be correct for all. But if its a DB-driven app, why would the data not be stored int he DB?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
Ok, consider, if I use Database for storing those values, then for every time the page getting displayed, then I have to get the values from database? If or can I store those values in JSP Application scope??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Depends how long they need to stay around and how often they'll change. Without some information and requirements around the data, it's impossible to give any advice.
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
consider It is an intranet Application,the use will use the page for long time through out the business hours(8 hours)
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
As Bear said, it depends on how long they need to be around AND how frequently they change, if they are not too heavy, they can be stored in the application's scope. We clearly assume here that a lot of users would read those values by sending concurrent and independent requests. If it is one odd user using the page and does not reload the page pretty often then the DB would be a better option.

Regards


Experience and talent are independent of age
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Where to keep values?
 
Similar Threads
Origin, destination and carrier JComboBoxes
Storing objects polymorphically in a Figure array
Session Lost from JSP to action
Does this count?
US salary trend