I'm working on a pretty big JSF application using Mojarra 2.1.13 and Primefaces 3.5. Recently I had an issue of getting java.lang.IllegalStateException: Cannot create a session after the response has been committed
exception. I cleared it by increasing the FACELETS_BUFFER_SIZE
by using context-param
in my web.xml
. Evenlthough I am not getting that exception anymore I have some questions regarding that:
FACELETS_BUFFER_SIZE
setting in a JSF app?FACELETS_BUFFER_SIZE
for my application? FACELETS_BUFFER_SIZE
represents the maximum amount of bytes that a buffer (i.g a form in our case) can be up to. It needs to be set in the web.xml only when the PROJECT_STAGE
is set to Development.
When the PROJECT_STAGE
is set to Production there is no need for the FACELETS_BUFFER_SIZE
to be set and can be left in its default setting (-1). Setting the FACELETS_BUFFER_SIZE
whilst in Development can prevent data loss or errors not logging correctly or even at all.
Setting this param to Development enables better error messages, including in the client-side JavaScript, at the cost of some performance.
While setting this param to Production will turn off some error messages, and emphasize performance.
The value (bytes) set in FACELETS_BUFFER_SIZE
while PROJECT_STAGE
is set to Development should be higher than your maximum size of your most heavy pages. You can see that if you open your application in firefox, right click in empty space and click on View Page Info, the current page size is shown there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With