Closed GoogleCodeExporter closed 9 years ago
So, my proposal is to do a method
WebXml.INSTANCE.findErrorPageLocation(exception) overwritable. You could add
this method to the FullAjaxExceptionHandler.java
protected String findErrorPageLocation(WebXml webXml, Throwable exception)
und change the call WebXml.INSTANCE.findErrorPageLocation(exception) to
findErrorPageLocation(WebXml.INSTANCE, exception).
This will allow to overwrite findErrorPageLocation(...) in a custom
ExceptionHandler. I could write e.g. in web.xml
<exception-type>ip.commons.exceptions.ServiceException?code=ACCESS_DENIED</excep
tion-type>
and parse this in a custom ExceptionHandler as I want.
Original comment by ovarak...@googlemail.com
on 13 May 2013 at 10:44
Or nothing overwrite. Simple extend WebXml to be able to parse exceptions in
this form
<exception-type>ip.commons.exceptions.ServiceException?getErrorCode=ACCESS_DENIE
D</exception-type>
I mean as a built-in feature. "getErrorCode" defines a method in
ServiceException which should be invoked via Java Reflections.
What do you think?
Original comment by ovarak...@googlemail.com
on 13 May 2013 at 10:52
Makes sense. I will add protected methods for overriding.
Original comment by balusc
on 15 May 2013 at 1:47
Added:
https://code.google.com/p/omnifaces/source/detail?r=2764ca087e235f5c2ea6ac82d155
06a993440cb7
Attached snapshot contains the changes.
Original comment by balusc
on 15 May 2013 at 1:56
Attachments:
Thanks guys!
Original comment by ovarak...@googlemail.com
on 15 May 2013 at 9:26
I have a question regarding this thread. Has it been implemented in Omnifaces
1.7 ?
As Oleg specified, can we mention the error code like this :
<exception-type>ip.commons.exceptions.ServiceException?getErrorCode=ACCESS_DENIE
D</exception-type>
If this is possible, it would be really really awsme!
Please clarify on this.
I have a custom exception class, and I tried to specify it as above and it
complained about ClassNotFoundException (Assuming
ip.commons.exceptions.ServiceException is my custom exception , something
similar I mean).
Is it possible to map the error pages with combination of
exceptionType+exceptionCode!
Help Appreciated!
Thanks!
Original comment by allampal...@gmail.com
on 11 May 2014 at 6:02
No. You have to override the method
findErrorPageLocation(...)
in the FullAjaxExceptionHandler with your custom code. Look this commit
mentioned above please
https://code.google.com/p/omnifaces/source/detail?r=2764ca087e235f5c2ea6ac82d155
06a993440cb7
Original comment by ovarak...@googlemail.com
on 11 May 2014 at 9:27
Original issue reported on code.google.com by
ovarak...@googlemail.com
on 13 May 2013 at 10:29