Print Multiple exceptions information thrown on update model
------------------------------------------------------------
Key: MYFACES-1887
URL: https://issues.apache.org/jira/browse/MYFACES-1887
Project: MyFaces Core
Issue Type: Improvement
Affects Versions: 1.2.3, 1.1.6-SNAPSHOT
Reporter: Leonardo Uribe
Assignee: Leonardo Uribe
When update model phase is executed, if multiple error occur when setting the
values (could occur when a value is set to a EL expression), the errors should
be added to the org.apache.myfaces.errorHandling.exceptionList, so the
FacesServlet can manage it properly like this:
Exception while ...............message 1..........
Exception while ...............message 2..........
Caused by:
........cause 1.......
........cause 2.......
.....stackTrace 1.....
.....stackTrace 2.....
Checking the code there is some errors like this (class UIInput myfaces core
1.1.5):
private void queueExceptionInRequest(FacesContext context, ValueBinding
binding, Exception e) {
List li = (List)
context.getExternalContext().getRequestMap().get(ERROR_HANDLING_EXCEPTION_LIST);
if(null==li) {
li = new ArrayList();
context.getExternalContext().getRequestMap().put(ERROR_HANDLING_EXCEPTION_LIST,
li);
li.add(new FacesException("Exception while setting value for
expression : "+
binding.getExpressionString()+" of component with path : "
+ _ComponentUtils.getPathToComponent(this),e));
}
}
Note the bad closing '}', it causes that previous errors be lost.
The idea is add a method to be called from FacesServlet like this:
class _ErrorPageWriter
public static void handleExceptionList(FacesContext facesContext, List
exceptionList) throws ServletException, IOException {
...........handle it..........
}
if no method on custom ErrorPageWriter is defined, the old way is used (just
show the first exception).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.