Comparison between makumba and JSF 2.0#

Both technologies seem to have evolved in parallel. An integration of JSF 2.0 as view for makumba seems to make a lot of sense.

Concern Makumba JSF 2.0 Comments
display action results / messages to the user <mak:response /> - displays form messages indicated in the <mak:form> 'message' attribute, the application logic and the validation error messages that could not be assigned to a form element <h:messages /> - displays all messages that come from validators or set in the application logic through FacesMessage
pretty much the same thing
send message from application logic throw new LogicException("This is an error"); FacesMessage message = new FacesMessage("Invalid email address"); throw new ValidatorException(message); FacesMessage brings support for localization
display form annotation messages <mak:form annotation="after/before/both/none"> <h:message for="inputId" /> mak seems to automate this process more than JSF 2.0
form validation validation rules in MDD or custom application logic application logic, greatly simplified through validation annotations (JSR 303)

navigation simple navigation model using <mak:form> 'action' attribute, or reloading of the page in case of errors if this is the configured behavior - <h:commandButton> 'action' attribute forwards to JSF page with same name as the action (if found)
- navigation rules specified in faces-config.xml, much in the same fashion as Struts does
JSF navigation model is clearly more powerful and closer to model 2, yet JSF 2.0 introduces simple 'action' elements that have the benefit of being simple and contained in the page. additionally, JSF has a range of UI components that execute actions (implement the ActionSource interface), thus being more flexible than the <mak:submit> which really only is part of a form.
request / page / view parameters makumba Attributes that bundle HTTP request parameters, HTTP session attributes, JSP page parameters (and more?) into one single object. The bundles parameters are available in makumba business logic through the Attribute object. In the JSP page, request/session/page parameters are available as usual in JSP (through e.g. usage of JSTL, or JSP scriptlets, or EL) JSF 2.0 introduces "view parameters" that have to be explicetly declared:
  <f:viewParam name="fName" value="#{userBean.firstName}" />
and later on can be used in order to produce bookmarkable links:
<h:commandButton value="Register" action="confirm?faces-redirect=true&amp;includeViewParams=true"/>

The latter piece of code leads to the generation of a bookmarkable link, with CGI params, as usual. JSF relies on its internal component tree to handle parameters otherwise (i.e. they are not exposed directly and submitted via POST, which also increases the security).
might increase the complexity in some cases for people coming from JSP

Comparison between JSP and JSF#

Concern JSP JSF Comments
markup JSP tags, java, HTML XHTML no java, only tags, with namespaces declared in the beginning
templating not really, <jsp:include> makes some code-reuse possible designed for code re-use through component composition
tag-libraries custom taglibs custom taglibs and custom UI components JSF desgin makes tag library development much easier, tag / component developers have access to the full page tree

Add Comment
« This page was last updated on May 16 2010