Hi
For my web pages development using struts, I have an issue. We get the a list of 600 data from the database which is to be loaded in the application each time we call it. This is how it goes now.
But is there a way that the entire data can be loaded in the application at once and use the data wherever needed.
Just a suggestion, try to group this 600 data into groups on basis of some fields preset in it. Pull the data based on the groups on a need to display basis so that you can reduce the load.
Brahmani Ganduri wrote:Hi
For my web pages development using struts, I have an issue. We get the a list of 600 data from the database which is to be loaded in the application each time we call it. This is how it goes now.
But is there a way that the entire data can be loaded in the application at once and use the data wherever needed.
600 db rows , is too big to walk with. If you do not care about the memory usage plus any performance impact, you can extend ContextListener class and store the rows(ResultSet object) in context scope..
If you memory is an issue, then do what Balagopal Kannampallil suggest.. Access them whenever they needed.
I guess, I was not clear with my post. Let me be clear.
I am using a list of 600 cities for my index page. In my index page, there is a text box which works as an auto suggester with the 600 cities. Is there a way I can load the list of 600 cities (which i am getting from db)
JUST ONE TIME, into my jsps for the entire application. This will increase the performance of my index page.
Brahmani Ganduri wrote:I guess, I was not clear with my post. Let me be clear.
I am using a list of 600 cities for my index page. In my index page, there is a text box which works as an auto suggester with the 600 cities. Is there a way I can load the list of 600 cities (which i am getting from db)
JUST ONE TIME, into my jsps for the entire application. This will increase the performance of my index page.
This is the general thing a web designer face many time, when you need to develop page where a drop down contains name of country, states, what is and what not..
The general and simple technique is to place all the 600 cities in a JSP/HTML (<option>city</option>)page it self.. It won't cause any problem, provided the name of cities won't change frequently..
Brahmani Ganduri
Greenhorn
Joined: Dec 10, 2008
Posts: 17
posted
0
Swastik Dey wrote:Do you mean that once the data is loaded and after that if the page is refreshed it wont reload the data again?
Hi
We are actually trying to get the list of stations, which match the first 3 letters of the station. We are using xmls for this, though ajax is a good one to do it.
Our issue is, once the stations are loaded in the application, they should not be reloaded or hit the database again.
Scope of the stations should be application. The station list is dynamic.
David Newton wrote:Or put the list in application scope on startup.
Thanks all for your replies.
David, we have actually tried to use the scope application also. But that was not working.
Now, we are trying to change the search pattern. As said, previously we were using xmls to get the station name which was performance issue.
Now, we are trying to use AJAX.
Bear Bibeault wrote:A context listener and application scope will work fine. If that's "not working" for you, you are doing it wrong.
Using Ajax for something like this would be ridiculous.
The station list is a drop down. and we are using the dropdown list wherever needed in the site. Application scope was not working.
Anyways, I will check again the whole code.