Thursday, 23 June 2011

Understanding Java Server Faces 2.0 Part 2

This is Second  part of JSF 2.0 discussion. Please visit part one 


Update : New Post JasperReports in JSF

In JSF 2.0 part 1  post, i used  @ManagedBean annotation for POJO java class. Its OK, actually it derived from JSF 1.2.But we should use @Named annotation instead of @ManagedBean, if CDI (Contexts and Dependency Injection) environment is available. I used Tomcat 7, its not Java EE 6 server and by default CDI is not available.

 But we can use JBoss's Weld lib for achieve CDI in tomcat with minimal configuration. Weld is reference implementation of CDI and its comes standalone version also. This standalone version weld provide CDI environment for both Web Application and Java SE application. By default Glassfish 3.0/3.1 server comes with weld  library for CDI Environment. Here i am using Glassfish server with CDI enabled.

Page Navigation
       This post we will discuss page navigation in JSF2.0. Page Navigation means flow of the application. From one page to another page. In JSF1.2 page navigation is achieved through faces-config.xml configuration file. But JSF 2.0 that configuration file is optional. JSF2.0 gives new feature is Implicit Navigation. So in JSF2.0 we can use page navigation in two ways either implicit navigation or through configuration files. we will see the both.

Contexts and Dependency Injection Series

Contexts and Dependency Injection (CDI ) JSR 299 is a new feature in Java EE 6 Web Profile .  Its Enhance the JSR 330 Dependency Injection in Java. CDI are highly used annotation. CDI makes Loose coupling between classes. To use javax.inject.Inject annotation, we can inject any class into another classes 

i put 4 part series of CDI, you can get it here




Tuesday, 21 June 2011

Why should I learn JSF

Java Server Faces (JSF) is one of the presentation web frameworks in java. There is lots of others frameworks like Spring, GWT, Wickets, Struts. Today this post we ll discuss why JSF is more important then others.Here I am not criticize any frameworks. i just talking about JSF.  


In JSF 1.2 and previous version of JSF used JSP as a view declarative language and JSP life cycle is not matched with JSF and ajax requests. JSF 1.2 are complex to use and they have some short coming in feature.

But JSF 2 is completely changed the adapt lots of technologies, but still its support backward compatible.Its very easy to learn. More over JSF is center piece in Java EE 6 Spec. It means that what are the new components or specification introduced in Java EE 6 are seamlessly integrated into JSF. Because those components spec is designed for JSF in mind.

Saturday, 18 June 2011

Understanding Java Server Faces 2.0 Part 1





Update : I put new post for Why should I learn JSF 
                I put new post for Understanding Java Server Faces 2.0  Part 2 


JavaServer Faces (JSF) is a Java-based Web application framework intended to simplify development integration of web-based user interfaces. Java Server Faces (JSF) 2.0 is a improved component of Java EE 6 Specification.  Its Component based model. Its is alternative technology for Struts, JSP, Spring. Its MVC (Model-View-Controller) based architecture.

Related Posts Plugin for WordPress, Blogger...