Wednesday, February 04, 2009

Apache MyFaces Trinidad

NOTE: some how all the xml related syntax is removed while rendering the post in blogspot.


My team is exploring the use of JSF into one of our applications.

We had smooth sail until we decided to use trinidad components. We wanted to have out of box support for the features we wanted to build into application and tomahawk and trinidad seem to be the way to go.
Some of the dependencies we had in our project POM file(related with myfaces and trinidad) are

org.apache.myfaces.core
myfaces-api
1.2.2
compile




org.apache.myfaces.core
myfaces-impl
1.2.2
compile



org.apache.myfaces.tomahawk
tomahawk
1.1.8
runtime


javax.servlet
jstl


org.apache.myfaces.core
myfaces-api


org.apache.myfaces.core
myfaces-impl





jstl
jstl
1.2
runtime



com.sun.facelets
jsf-facelets
1.1.11




org.apache.myfaces.trinidad
trinidad-api
1.2.1




org.apache.myfaces.trinidad
trinidad-impl
1.2.1


org.apache.myfaces.trinidad
trinidad-build
1.2.1



Contents of web.xml






contextConfigLocation
classpath:applicationContext.xml


org.springframework.web.context.ContextLoaderListener


org.springframework.web.context.request.RequestContextListener


org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL
true


facelets.LIBRARIES
/WEB-INF/tomahawk.taglib.xml


javax.faces.DEFAULT_SUFFIX
.xhtml


facelets.DEVELOPMENT
true


javax.faces.CONFIG_FILES
/WEB-INF/backoffice-config.xml


javax.faces.STATE_SAVING_METHOD
client


org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
20


org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
true


org.apache.myfaces.COMPRESS_STATE_IN_SESSION
true


org.apache.myfaces.ALLOW_JAVASCRIPT
true


org.apache.myfaces.DETECT_JAVASCRIPT
false


org.apache.myfaces.PRETTY_HTML
true


org.apache.myfaces.AUTO_SCROLL
true


org.apache.myfaces.SECRET
NzY1NDMyMTA=


org.apache.myfaces.VALIDATE
true


org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS
true


org.apache.myfaces.ADD_RESOURCE_CLASS
org.apache.myfaces.renderkit.html.util.DefaultAddResource


org.apache.myfaces.RESOURCE_VIRTUAL_PATH
/faces/myFacesExtensionResource


org.apache.myfaces.CHECK_EXTENSIONS_FILTER
true


javax.faces.PARTIAL_STATE_SAVING_METHOD
false



extensionsFilter
org.apache.myfaces.webapp.filter.ExtensionsFilter

uploadMaxFileSize
100m


uploadThresholdSize
100k



extensionsFilter
*.jsf


extensionsFilter
/faces/*


org.apache.myfaces.webapp.StartupServletContextListener


Faces Servlet
javax.faces.webapp.FacesServlet
1


Faces Servlet
*.jsf


index.jsp
index.html


trinidad

org.apache.myfaces.trinidad.webapp.TrinidadFilter



trinidad
Faces Servlet


resources

org.apache.myfaces.trinidad.webapp.ResourceServlet



resources
/adf/*



org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER
com.sun.facelets.FaceletViewHandler



facelets.VIEW_MAPPINGS
*.xhtml





faces-config.xml content is



org.springframework.web.jsf.DelegatingVariableResolver


org.apache.myfaces.trinidad.core




Eclipse design time didnt handle trinidad tags properly (no UI rendering for tr components),but it worked fine.

What I needed was to select rows in table using radio button option. It looks simple functionality but always it created problem. I remember doing some custom java script implementation to handle it, then we had difficult time even in .Net development. Now in java also we spent few days in fixing some very basic issue.
It is not technology which need to be blamed all the time. if we started with the formal instructions, it would have been very easy for us.

No comments: