Programmer's Blog Programmer's Blog

Development of Java™ Portlets using JSR 286: Java Portlet 2.0 API, Java Server Faces (JSF 1.2 & 2.0) and Ajax

In order to cope with the challenges of contemporary business environment including globalization, economical pressure for better efficiency, business process outsourcing, achievement of regulatory compliance, the enterprise needs improved support by technology. Recently the term Service Oriented Architecture (SOA) has become a pervasive buzz word together with Cloud Computing, Software as a Service (SaaS), etc. The SOA standards like: Simple Object Access Protocol (SOAP), Web Services Description Language (WSDL), Universal Description Discovery and Integration (UDDI), Representational STate Transfer (REST), Web Application Description Language (WADL) have emerged and matured. But from the end user perspective all these technologies do not matter much.

In 2002 the Java™ community started a pioneering effort for standardization of the web-based presentation services as well. They were called portlets and were able to be easily combined and integrated into enterprise portals based on a common standard defining their interaction – JSR 186: Java Portlet Specification. In 2005 it was followed by another more advanced specification – JSR 286: Portlet Specification 2.0.

Portals offer many advantages over other software applications. First, they provide a single access point for all employees, partners, and customers. Second, portals provide access to business functionality transparently from any device in virtually any location. Third, portals are highly flexible; they can exist in the form of B2E intra-nets, B2B extra-nets, or B2C inter-nets. Fourth, portals can be combined to form a portal network that can span a company's ecosystem. Fifth, because they provide front end for different web services they can easily integrate existing heterogeneous software systems and are future-proof.

In the recent years portlets became popular technology allowing easily to share and combine web applications developed by different organizations and individuals in a personalized enterprise portal. A new "portlet-based" style of web application development has emerged. Portlet apps (PA) are more distributed, flexible and agile, compared to older style, monolithic web applications we know for years. PA can use asynchronous data requests and can be dynamically updated in response (and sometime in anticipation) to user's needs. They are typically consisting from several different portlets that communicate using shared parameters or publish/subscribe events according to latest Portlet Specification 2.0.

The Web Services for Remote Portlets (WSRP) OASIS network protocol specification allows the portlets to be accessed remotely and combined easily by third party portals and consumers. It is supported by all of the portal market's major players, including Oracle®, IBM®, Microsoft®. The ultimate goal of WSRP is to bring the benefits of Service-Oriented Architecture to the end-user.

In order portlet technology to become even more successful are needed developer frameworks and tools that support rapid portlet application development and reuse of components. As part of Java™ Enterprise Edition standardization process and as a recommended technology for web based presentation in the latest version of Java™ EE 6, Java Server Faces (JSF) framework became most promising candidate for such an enabling technology. Among the advantages of JSF are:

  • easy construction of UI from a set of reusable components;

  • clear separation between data and presentation using MVC design pattern;

  • easy to use model for wiring client-generated events to server-side application code;

  • UI components state managed automatically across client requests;

  • separation of concerns between corporate developers and system programmers.

The latest version of JSF 2.0 provides additional advantages:

  • more flexible and standard based presentation components using facelets;

  • easy to use view/page templating;

  • easy to create custom components without Java programming by composing existing components;

  • seamless and unified integration with all different types of beans (ManagedBeans, POJO, EJB) using dependency injection annotations;

  • new scopes (e.g. conversation scope, custom scopes);

  • bookmarkable application states using view parameters;

  • better ajax support using standard tags – no need to manually write JavaScript code;

  • partial view processing and rendering during ajax requests;

  • easier configuration, navigation and resource loading.

JSF technology provides many nice capabilities simplifying the development process, but there are some problems using JSF directly for portlet development. The most important one is the difference in lifecycles of portlets and JSF componentsportlets separate action, event, resource and render requests, while standard JSF servlet handles them in a common request processing lifecycle. That is why a bridge between two technologies is needed in order to combine their advantages. Two new specification requests (targeted towards different versions of the portlet specification) were published to address this need – JSR 301: Portlet 1.0 Bridge for JavaServerTM Faces 1.2, and JSR 329: Portlet 2.0 Bridge for JavaServerTM Faces 1.2 Specification.

The following presentation the autumn meeting session of BGOUG - Bulgarian Oracle User Group shows in more detail Java portlets development process using JSF 1.2 technology (including JSR 301 and JSR 329 open source implementations) and provides insight about emerging initiatives for development of Portlet 2.0 to JSF 2.0 bridge (no specification available yet). Practical examples using open source technologies will be demonstrated to participants illustrating the concepts, and proving the value of the technologies.

IPT presentation at BGOUG meeting in Pravet, 19.11.2010:

Development of Java™ Portlets using Java Portlet 2.0 API, Java Server Faces (JSF 1.2 & 2.0) and Ajax (.pdf)

 

 

--

*Oracle®, Java™ and EJB™ are trademarks or registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.


 

Showing 1 result.

H2J Announcements H2J Announcements

  • Entries

10-08-2011: New Collaboration Space for Java Developers

General Welcome to H2J, a new collaboration space where Java Developers can share their ideas, knowledge and experience.

H2J Blogs H2J Blogs

In order to cope with the challenges of contemporary business environment including globalization, economical pressure for better efficiency, business process outsourcing, achievement of
I am very excited about this! Administrating the portal with a few clicks is now very easy, you just have to acces the Control Panel in the dock menu (top right) to do any of the following things:
In my previous entry I told you how I could manage the entire portal from the Control Panel. In this entry I wanted to show you how you can configure the preferences of your portal. There is a
RSS (Opens New Window)
Showing 3 results.