File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retreiving more than 250 records everytime

 
Ali Khalfan
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've written an application in JSTL where the user would need to update some regional settings. So I have a combo box where the user can selected the right country like:








The Method in the class looks like this:








The problem is I have several pages that do this and the user may try to do this several times. This will slow down the system as the user would need to retrieve the records every from the database all the time.

Is there a way I can this to be done only once and then save the List somewhere in memory?

Really appreciate it
 
Paul Clapham
Sheriff
Pie
Posts: 20208
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course. The country list is the same for all users and will never change? Then you could save it in the application scope.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ali Khalfan:
I have a combo box ...

Correction: it's not a "combo box". That's a desktop control that is not available on the web. It's more correct to call it a "select" or a "dropdown".
 
Ali Khalfan
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I apologize..yest it is a select

Paul, can you tell me how to save it in the application score I'd appreciate it
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it were me, I'd read in the values using a context listener, which would trigger once when the app is loaded. Then create the scoped variable in application scope using servletContext.setAttribute().
[ December 28, 2007: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic