0

I'm working migrating a legacy software that use a lot of cases like <ui:repeat var="area" value="#{areaList.getResultList()}">. Where getResultList() executes a DB query. One of the problems is that when an ajax call is made, JSF at the phaseId 2 (APPLY_REQUEST_VALUES) visit all UIViewRoot children, and executes this DB queries.

The question is, there is a way to avoid this? Is correct to think when the request is an ajax type, don't visit all children. Is a JSF / JSF 2 issue or Primefices issue? The migration also include JSF 1 to JSF 2 (Mojarra)

(I have zero chance to modify the way of value is retrived)

UPDATE:

I'm using Wildfly 25.0.0 (it comes with jsf 2.3 by def) and JSF 2.1 Mojarra_2.1.29. But if you observe the stack when de ui:repeat is being accessed:

enter image description here

PartialViewContextImpl belong to JSF 2.3 (not mojarra_2.1.29) and there is where the original problem is, I think.

The strange is when the app starts, the log says:

INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 85) Inicializando Mojarra 2.1.29

I followed the next doc to configure a new JSF implementation on Wildfly: Link

UPDATE

I've extended UIRepeat and then solved my problem: enter image description here

Thanks!

Jose Ignacio Larghi
  • 488
  • 1
  • 7
  • 11
  • Does this answer your question? [Why JSF calls getters multiple times](https://stackoverflow.com/questions/2090033/why-jsf-calls-getters-multiple-times) – Jasper de Vries Feb 17 '22 at 13:02
  • No, I know about that behavior, but in my case is an ajax request where the ui:repeat is not going to be updated. Thanks for the suggestion. – Jose Ignacio Larghi Feb 18 '22 at 09:14
  • I don't see any PrimeFaces code here just `ui:repeat` so are you sure its not a change when you upgraded did you upgrade Mojarra versons? Server versions? Can post more code showing PF is the issue? – Melloware Feb 18 '22 at 14:06
  • I think the problem is related with JSF version. I've updated the question. – Jose Ignacio Larghi Feb 18 '22 at 16:27

0 Answers0