adminfaces / admin-template

JSF responsive admin template based on Bootstrap and AdminLTE
https://adminfaces.github.io/docs/latest/#admin_template
MIT License
209 stars 101 forks source link

Missing ExceptionHandler documentation #183

Open jomu78 opened 5 years ago

jomu78 commented 5 years ago

In order to get the error handling and the provided error pages working, it is required to specify the provided CustomExceptionHandlerFactory in faces-config.xml. If another exception handler like PrimeExceptionHandlerFactory or FullAjaxExceptionHandlerFactory is used, the error handling does not work.

Additionally exception filters like e.g. org.omnifaces.filter.FacesExceptionFilter configured in web.xml seem to be not required.

The documentation page does not mention this. I think we should either mention this in Chapter 2 "Usage" or in Chapter 6 "Error pages". I would prefer chapter usage for a full how to install / configure / use overview.

This would help new users to start with admin-template.

Test environment

rmpestano commented 5 years ago

Hi,

In order to get the error handling and the provided error pages working, it is required to specify the provided CustomExceptionHandlerFactory in faces-config.xml.

It comes within admin-template faces-config, see here, you shouldn't need to declare on your faces-config.

Now you raised an interesting point, that the handler may not work as expected if another handler like FullAjaxExceptionHandlerFactory is also in place.

I'll make some tests, thanks for the feedback.

jomu78 commented 5 years ago

Hi, your are right - it is probably more the issue to document what NOT to do. My tests did not work, when I added any other factory but it works if I remove the factory completely from my faces-config.xml and just rely on what admin-template provides.

PrimeExceptionHandlerELResolver is probably then also not required!?

I still need to test, if omnifaces FacesExceptionFilter is still required to be configured in web.xml and if it will work at all.