java.lang.IllegalStateException: Cannot forward a response that is already committed on a JSF action with sendRedirect/forward in ADF

This kind of java.lang.IllegalStateException exception are triggered when some Java code is executed after a forward(), sendRedirect() or sendError().
You can refer to this StackOverflow thread to learn more about how to avoid this in Java: here

I’ve encountered this error in ADF a couple of time when you use a forward(), sendRedirect() or sendError() in a JSF action even if you do add the return; as ADF execute its own java code at the end of an action.

To avoid this you have to keep the business logic inside the action handler and move the forward(), sendRedirect() or sendError() inside the ActionEventListener operation.

Example :

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top