I am new to JSF 2.0 and Primefaces but have decided to create my application using them seeing the primefaces showcase.
I have completed my application but have noticed that it is extremely slow. I have placed some system.out.println in various places to see what is being called and I noticed that sometimes methods in my controller such as methods that call my DAO to retrieve values from the Database are being called up to 6 times on one event! My pages have a lot of datatables in them so sometimes multiple datatables * 6 calls for each list being populated in each table seems like this is what is causing the slowness.
I am not sure what I have done wrong or if I did anything wrong but in my controller for instance I have a method that might look like this,
public List<Addresses> getAddresses() {
List<Addresses> addr = systemDao.getAddresses(userBean.userId);
return addr;
}
in the view I will then call this method like on a datatable element to display the result.
When I first load it it will only call this once but when I click maybe a button to open a dialog with completely unrelated data this getAddresses() might be called 3 - 6 times and it has nothing to do with the data the I am requesting during the current action. Is anyone familiar with this and how I could maybe speed up my application?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…