You should be able to use the advice given earlier and just change your code
to, especially since you already seem to have a property called userList in
the class.
public List getUserList() {
if( userList != null ){
return list;
}
// Service Locator instance
IServiceLocator iSL = ServiceLocator.getInstance
().getIServiceLocator();
try {
// Search result list. Access to LDAP
list = iSL.getAuthorizationService().searchUsers(usc);
this.userList = list;
} catch (TimeOutConnectorException tex) {
tex.printStackTrace();
this.message = "Se excedió el tiempo máximo de
respuesta.Inténtelo de nuevo.";
} catch (Exception ex) {
ex.printStackTrace();
}
return userList;
}
On 27/09/2007, Angel Miralles Arevalo <[EMAIL PROTECTED]> wrote:
>
> Well I'm using an arrayList to charge a <t:dataTable> uicomponet. Here is
> my code, sorry about not sending it before:
>
> Here es the *managed-bean:*
>
> public List getUserList() {
> // Service Locator instance
> IServiceLocator iSL = ServiceLocator.getInstance
> ().getIServiceLocator();
>
> try {
> // Search result list. Access to LDAP
> list = iSL.getAuthorizationService().searchUsers(usc);
>
> this.userList = list;
> } catch (TimeOutConnectorException tex) {
> tex.printStackTrace();
> this.message = "Se excedió el tiempo máximo de
> respuesta.Inténtelo de
> nuevo.";
> } catch (Exception ex) {
> ex.printStackTrace();
> }
> return userList;
> }
>
> The red code is where LDAP access is made.
>
> And the *JSF code* is:
>
>
> <
> t:dataTable styleClass="porcen100 left" id="users_tab_PPR"
>
> border="0" bgcolor="#AEB8D4" cellspacing="1" cellpadding="0"
>
>
> headerClass="list-header"
>
> rowClasses="datos_impar_off,datos_par_off" var="usersListPPR"
>
>
> value="#{authorizationUsersListBean.usersList}"
>
> binding="#{authorizationUsersListBean.UITable}"
>
> preserveDataModel="false"
>
> sortColumn="#{authorizationUsersListBean.column}"
>
> sortAscending="#{authorizationUsersListBean.ascending}"
>
> preserveSort="true" renderedIfEmpty="false"
>
> rowOnMouseOver="mouseOverTable(this,'#9dcbe3')"
>
> rowOnMouseOut="mouseOutTable(this)"
>
> columnClasses="hleft porcen20, hleft porcen35,hleft
> porcen35, hcenter porcen10">
> ........
>
> Thank you very much!!
> ----- Mensaje original ----
> De: Richard Yee <[EMAIL PROTECTED]>
> Para: MyFaces Discussion <[email protected]>
> Enviado: jueves, 27 de septiembre, 2007 14:14:07
> Asunto: Re: Perfomance problem with JSF
>
> How are you using your LDAP ArrayList? Should you be using a Map
> instead? Is the getter/setter in a ManagedBean or somewhere else? Are
> you doing more in your getter than just returning an instance variable?
>
> Angel Miralles Arevalo wrote:
> > Hi everybody, I have a perfomance problem with JSF. I have a
> > java arraList attribute. This attribute have getter and setter
> > methods. It is used to store LDAP users, so I have to access LDAP in
> > getter method.
> >
> > Because of the lifecycle the getter is invoked twice, so LDAP access
> > is twice too. The problem is my LDAP has around 15000 users. My web
> > application is getting very slow.
> >
> > How can I customize this behaviour??
> >
> > Thanks in advanced.
> >
> > ------------------------------------------------------------------------
> >
> > Sé un Mejor Amante del Cine
> > ¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
> > <
> http://us.rd.yahoo.com/mail/es/tagline/beabetter/*http://advision.webevents.yahoo.com/reto/entretenimiento.html
> >.
>
>
> ------------------------------
>
> Sé un Mejor Amante del Cine
> ¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
> <http://us.rd.yahoo.com/mail/es/tagline/beabetter/*http://advision.webevents.yahoo.com/reto/entretenimiento.html>
> .
>