I'm trying to gain some performance on my application that search members in groups in ldap. My page shows 5 drop down lists which countains groups from different domains (around 150+ in each). I noticed that my application spend most of the time loading those drop down lists and little time doing the actual search. I was wondering if there is a way to load them once and then use them until the session is closed. Sample of code from my servlet :
public void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException {
...
// Get the groups for the 5 drop down lists
dropdownlist1 = gvf.getGroupes1();
dropdownlist2 = gvf.getGroupes2();
dropdownlist3 = gvf.getGroupes3();
dropdownlist4 = gvf.getGroupes4();
dropdownlist5 = gvf.getGroupes5();
// Set the attributes to return to the vue
request.setAttribute( ATT_FORM, gvf );
// Session scope attributes ???
HttpSession session = request.getSession();
session.setAttribute( ATT_GROUP1, dropdownlist1 );
session.setAttribute( ATT_GROUP2, dropdownlist2 );
session.setAttribute( ATT_GROUP3, dropdownlist3 );
session.setAttribute( ATT_GROUP4, dropdownlist4 );
session.setAttribute( ATT_GROUP5, dropdownlist5 );
}
So I'm not sure if I need to add some code to my jsp or how to test is this is working. I'm using eclipse and with the debugger I see that the 5 getGroupes functions are called everytime I load the page instead of once. Am I missing something ?
edit: I'm pretty sure I'm missing some kind of "if drop down list not loaded --> load drop down list, else continue"