3

Can any one list out the tips to tune JSF WebApp @ its best.

2 Answers2

5

JSF RichFace

Never put logic into your getters. They are called multiple times and should only return something already populated by another method. For example if you are chaining drop-downs together use an a4j:support tag on the first one with an action attribute that loads the data which is then retrieved when you reRender the second one.

Use the ajaxSingle="true" unless you actually want to send the whole form back to the server.
Don't use a rich component if you only need a normal one. For example don't use rich:dataTable unless you are making use of some of the features that it has over and above h:dataTable.

Consider using immediate=true attributes on elements where you do not need validation Avoid displaying large tables to user.

Use pagination Do not over complicate EL expressions, code them in Java in backing bean

JSF BestPractices
Performance Tuning

jmj
  • 237,923
  • 42
  • 401
  • 438
  • 2
    Some of the comments in JSF BestPractices are old. for example the usage of c:if - it's not recommended to use JSTL in JSF. it also breaks some functionality like ViewScope in JSF2 – Dejell Aug 26 '10 at 13:34
  • 3
    More I am expecting from BalusC. – jmj Aug 26 '10 at 13:40
  • 1
    http://stackoverflow.com/questions/628570/jsf-tuning this also seems a relevant discussion – Anand Sunderraman Jan 11 '12 at 09:15
1

Moving to Stateless JSF would offer a great performance boost. Now it's possible to use JSF entirely stateless. See this blog & this issue. A payoff is that you can't create views dynamically (e.g. by binding, JSTL tags, etc), nor manipulate it after creation.


A Stateless JSF operation mode would be incredibly useful for high-load applications and architectures:

http://industrieit.com/blog/2011/11/stateless-jsf-high-performance-zero-per-request-memory-overhead/#comment-4

This has previously been suggested by Jacob: http://weblogs.java.net/blog/jhook/archive/2006/01/experiment_goin.html

This would help JSF ditch the stigma of "slow and memory hog," and help keep up with current tech trends (stateless architectures.)

Rajat Gupta
  • 25,853
  • 63
  • 179
  • 294
  • Is JSF really required in that case ? – Christophe Roussy Aug 20 '12 at 12:18
  • 2
    stateless JSF is just an extension to mojarra implementation of JSF. So your pages would load superfast as the view is not rebuit/modified everytime, & you also say goodbye to those stale views(incase you used server state saving mode) while you enjoy all the other advantages of fast & easy development with JSF. Checkout the link for details – Rajat Gupta Aug 21 '12 at 07:37