facelets - Custom jsf component to include page with fallback -
i'm in trouble basic custom component built (using jsf1.2 , facelets) it's same regular ui:include, renders own children if includefile cannot found (instread of exception in ui:include).
here code of apply() function within taghandler: view plaincopy clipboardprint?
if (path == null || path.length() == 0) { log.debug("path empty or 0: src=" + src + ";path=" + path); included = false; } else { variablemapper orig = ctx.getvariablemapper(); ctx.setvariablemapper(new variablemapperwrapper(orig)); try { this.nexthandler.apply(ctx, null); ctx.includefacelet(parent, path); } catch (java.io.filenotfoundexception ex) { log.debug("failed include page: " + ex.getmessage()); included = false; } { ctx.setvariablemapper(orig); } } if (!included) { // includepage not included, render child tags fallback this.nexthandler.apply(ctx, parent); } if (path == null || path.length() == 0) { log.debug("path empty or 0: src=" + src + ";path=" + path); included = false; } else { variablemapper orig = ctx.getvariablemapper(); ctx.setvariablemapper(new variablemapperwrapper(orig)); try { this.nexthandler.apply(ctx, null); ctx.includefacelet(parent, path); } catch (java.io.filenotfoundexception ex) { log.debug("failed include page: " + ex.getmessage()); included = false; } { ctx.setvariablemapper(orig); } } if (!included) { // includepage not included, render child tags fallback this.nexthandler.apply(ctx, parent); }
problem though, code fails on "this.nexthandler.apply(ctx, null), saying "parent uicomponent null. doesn't give me error there when make sure tag not have child tags...
is there facelets expert around here knows i'm doing wrong? lot in advance!
Comments
Post a Comment