Sunday, March 22, 2009

Integration of JSF and Spring

JSF is a very popular presentation framework for web applications. It has got very rich repository of components as well. Spring help structuring whole application in a consistent, productive manner, pulling together best-of-breed frameworks. Spring enable developers to work with POJOs. Spring is a lightweight container, providing centralized, automated configuration and wiring of application objects.
So JSF in web tier and Spring in middle tier become an obvious choice. This document explains the steps involved in integrating these two frameworks.

Steps involved in integration
1. Add following lines in web.xml


This will load Spring Application context when web application starts.

2. Add applicationContext.xml file in WEB-INF folder
applicationContext.xml is a Spring configuration file. In the below snippet shows JSF managed bean entry.



3. Add following lines to faces-config.xml


When the code sample above is executed then the DelegatingVariableResolver would check to see if "SampleView" exists in spring and if it exists as a JSF managed bean as well. If it does DelegatingVariableResolver will then check to see if the bean already exists in the scope specified by and returns that instance if it exists. Otherwise, VariableResolver creates a new bean (SampleView), performs the JSF wiring on any managed properties on top of the already wired spring bean, stores the bean in the scope specified, and returns it.

Above is one of the ways of integrating JSF and Spring. With this approach advantages of both the frameworks can be achieved. Using this approach one can also integrate Faces Portlets with Spring based business tier.

Thursday, February 26, 2009

TIBCO General Interfaces (GI)


Now a day everybody talks about building internet applications using Rich User Interface. It makes sense also as Rich User Interface gives Rich User Experience. There are lots of frameworks in the market for building Rich Internet Application like Flex, Bindows, GI etc. In this article we will take a look at TIBCO General Interfaces.

TIBCO GI is a cool tool to develop Rich Internet Applications (RIA). TIBCO GI is based on Ajax technology. It has got a set what TIBCO calls ‘Lean Javascript’ libraries. GI Framework has got rich set of UI components and provides all the features that a typical web framework has like MVC, data binding, caching, localization, logging and debugging. Following are the some highlights about TIBCO GI.

IDE
The worst problem with typical RIA frameworks is unavailability of IDE. Because of this developer has to hand code everything, which obviously brings the productivity down. With GI this problem is not there. It has got amazing IDE (General Interface Builder), which is built on the same framework. GI Builder IDE looks very similar to VB with drag-drop features, enabling developer to build UI very quickly and easily. This IDE is packed with some cool tools like one can debug Javascript which is otherwise very difficult. It has got Error Console which lists Javascript errors which IDE has detected. Also it does not need any installer, it runs in a browser!!

Javascript Based
GI is completely based on Javascript which loads and runs in end user’s browsers. All UI components have events, on which Javascript functions can be called.

API Documentation
GI has got very well structured API documentation just like Java. One can find this in help section of the IDE.

Webservice Mapping
This is another feature which I liked the most. You can expose your business logic as Webservice and GI allows you to map input and output parameters with UI components, that tool having drag-drop features.

Integration
GI integrates well with major J2EE frameworks like Struts, Spring etc.


Browser Compatibility
GI supports all major browsers like IE, Firefox, etc. This enables developer to focus on business rather than focusing on browser specific coding.

Rich Component Library
GI has got very good component library which you can just drag-drop and start building the application. It has got very rich set of components like various grids, charting components, etc.

And above all, TIBCO GI is ‘Open Source’.

Interested…. Want to try out some stuff using GI… Refer following links

TIBCO GI Home : http://gi.tibco.com/
TIBCO GI Resource Center: http://www.tibco.com/devnet/gi/
TIBCO GI with Spring: http://www.theserverside.com/tt/articles/article.tss?l=AjaxandSpring