Lambda expression for validating if all view parameters are valid:
<h:body>
#{facesContext.validationFailed ?
(vdl = facesContext.application.viewHandler.getViewDeclarationLanguage(facesContext, view.viewId);
viewMetadata = vdl.getViewMetadata(facesContext, view.viewId);
allViewParams = viewMetadata.getViewParameters(view);
allViewParams.size() gt 0 ? (allViewParams.stream().forEach((t) ->
(t.valid ? '': (facesContext.externalContext.responseCommitted ? '' :
facesContext.externalContext.responseSendError(400,"One of your view parameters is invalid !");
facesContext.responseComplete())))):''):''}
<h:outputText value="All view parameters are valid!"/>
</h:body>
Niciun comentariu :
Trimiteți un comentariu