AjaxExceptionHandlerFactory

Community Driven Extensions Project
Post Reply
Primeval
Posts: 45
Joined: 23 Apr 2012, 19:48
Location: Berlin, DE

11 Jun 2012, 17:17

Hi,

I play around a little bit with the new version of the primefaces extensions (0.5). The remote command impl. is a great feature but Is there any possibility to disable or to override the AjaxExceptionHandlerFactory impl.? I have several problems with this implementation. e.g.

If I usedPrettyfaces URLActions I got an NPE

Code: Select all

java.lang.NullPointerException
	at org.primefaces.extensions.component.ajaxerrorhandler.AjaxExceptionHandler.handle(AjaxExceptionHandler.java:68) [primefaces-extensions-0.5.0.jar:0.5.0]
There for the

Code: Select all

public void handle() throws FacesException {
		FacesContext context = FacesContext.getCurrentInstance();

		if (context.getPartialViewContext().isAjaxRequest()) {
....
the getPartialViewContext() is null at this point.

Regards
Primefaces 4.0, Primefaces Ext. 1.0.0,
Prettyfaces 3.3.3/ URLRewrite 2.0.7, OmniFaces 1.5 (1.6.1 -> testing), Atmosphere 2.0.2, JBoss EL 2.2, JUEL 2.2.6
JBoss 7.1.1 with Mojarra 2.1.26

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

11 Jun 2012, 17:40

General, AjaxExceptionHandler doesn't modify error handling. It only put additional infos to the response.

NullPointerException, you shown, seems to be a bug with PrettyFaces. Sure we need safer checks and possibility to disable this AjaxExceptionHandler (per config.in web.xml). Time for a 0.5.1 release :-)
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

11 Jun 2012, 17:42

Better solution: remove AjaxExceptionHandler from faces-config.xml in PF Extensions and put it to faces-config.xml in custom project if pe:ajaxErrorHandler is needed.

I think we will do a 0.5.1 release very soon.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Primeval
Posts: 45
Joined: 23 Apr 2012, 19:48
Location: Berlin, DE

11 Jun 2012, 17:45

Hi,

without the AjaxExceptionHandlerFactory the URLAction work's but I have a fix for it. I register a custom Exception Handler factory and it seem the AjaxExceptionHandlerFactory is not called.

But Thx for the reply.

Regards
Primefaces 4.0, Primefaces Ext. 1.0.0,
Prettyfaces 3.3.3/ URLRewrite 2.0.7, OmniFaces 1.5 (1.6.1 -> testing), Atmosphere 2.0.2, JBoss EL 2.2, JUEL 2.2.6
JBoss 7.1.1 with Mojarra 2.1.26

Primeval
Posts: 45
Joined: 23 Apr 2012, 19:48
Location: Berlin, DE

11 Jun 2012, 17:46

:D you were faster...
Last edited by Primeval on 11 Jun 2012, 22:31, edited 1 time in total.
Primefaces 4.0, Primefaces Ext. 1.0.0,
Prettyfaces 3.3.3/ URLRewrite 2.0.7, OmniFaces 1.5 (1.6.1 -> testing), Atmosphere 2.0.2, JBoss EL 2.2, JUEL 2.2.6
JBoss 7.1.1 with Mojarra 2.1.26

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

11 Jun 2012, 17:51

Issue created http://code.google.com/p/primefaces-ext ... ail?id=193 Thanks for reporting!
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Pavol Slany
Posts: 20
Joined: 11 Jun 2012, 15:38
Location: Bratislava, Slovakia
Contact:

11 Jun 2012, 19:16

Hi,

I think, removing AjaxExceptionHandlerFactory from faces-config.xml is not good idea.
The most JSF libraries has a lot of factories in faces-config.xml, why not PrimeFaces Extensions?

@Primeval: NullPointerException is fixed in current repository version. Can you check it please?

Best regards!

Primeval
Posts: 45
Joined: 23 Apr 2012, 19:48
Location: Berlin, DE

11 Jun 2012, 23:03

Hi,

ok. I check it tomorrow.

-> AjaxExceptionHandlerFactory: May be it will be more flexible to make the AjaxEceptionHandlerFactory configurable over a context-parameter in the web.xml. According to this value (e.g. true|false) the exception handler will be added or not.

Regards
Primefaces 4.0, Primefaces Ext. 1.0.0,
Prettyfaces 3.3.3/ URLRewrite 2.0.7, OmniFaces 1.5 (1.6.1 -> testing), Atmosphere 2.0.2, JBoss EL 2.2, JUEL 2.2.6
JBoss 7.1.1 with Mojarra 2.1.26

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

11 Jun 2012, 23:13

If we make it configurable, it would be better the remove it from our faces-config. Adding a context param is just another wrapper for that.

@Pavol
It it works without problems, we should leave as it is. We shoud just wait for further user response after 0.5.1 relase.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests