2

We are migrating an old Seam webapp (Seam 2.2, JSF 1.2, JBoss 5.1) to JBoss 7.1 (Seam 2.3, JSF 2.0) and facing this srange problem:

All the EL expressions as value of <ui:repeat> within conditionally rendered <s:fragement> tags are evaluated to null which causes NPE during render response phase. The strange thing is, why did Facelets or JSF try to evaluate these EL expressions although the conditions (the rendered attribute of <s:fragment>) for them to be rendered didn't apply?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
tunggad
  • 285
  • 2
  • 13
  • Ignoring the technical problem for now (I don't recognize this for now, perhaps Seam related), this indicates a design problem: you're doing business job in a getter method. Why? – BalusC Nov 27 '12 at 16:59
  • Im not doing any logic in those expressions, they are just a chain of getter calls. These same expressions, when places elsewhere (as value of h:outputText beside the ui:repeat) did not make any trouble! So, the trouble maker seems to be the ui:repeat tag within the conditional rendered tags – tunggad Nov 27 '12 at 17:03
  • EL is normally null-safe. The NPE can only originate in business logic. I'm curious to the stacktrace, just to check if you interpreted the problem right. – BalusC Nov 27 '12 at 19:21
  • I have a similar issue where I wrap tags in s:fragment because the backing object is of various types and it is only possible to evaluate certain tags if the backing object is of a certain type. This code now fails because the tags are being evaluated when they should not be. – cyberoblivion Sep 13 '13 at 18:20

0 Answers0