Seam Seamless Integration: Customizing the application framework for JSF

Source: Internet
Author: User
Tags documentation exception handling require java web jboss

JavaServer Faces (JSF) is the first standardized user interface framework for Java™web applications.

And Seam is a powerful application framework to extend JSF. In the first article in this three-part new series, the complementarity between the two frameworks is found. Dan Allen describes the enhancements of Seam to the JSF lifecycle, including context state management, RESTful URLs, Ajax remoting, appropriate exception handling, and conventions over configuration.

JSF is starting to dominate the Java Web application market with its Java Web standards status. As more developers are commissioned to use JSF as a basis for architecting applications, they discover that JSF's core specification clearly shows that JSF is not designed to be a complete WEB application framework. Instead, it provides a robust, event-driven API and UI component library for building more complex application frameworks.

When I looked for an extension of the component-driven architecture that was used to make up JSF, I found that Shale and Struts 2 were deficient. I ruled out Struts 2 because it sees JSF as a larger-scale design. And Shale seems to be closer, and it's basically based on JSF, but I have reservations about that. In contrast, JBoss Seam is a comprehensive application framework built on JSF, but does not compromise its core objectives.

This three-part series introduces the Seam application framework, demonstrates its benefits, and hopes to convince you that it is an excellent combination of Java enterprise application development with JSF. Before reading this series, if you want to download Seam, please read the Resources section.

Find Seam

Having just read the first page of an article on JBoss Seam (see Resources), I knew that Seam was the project I was looking for. Seam developers, especially Gavin King, know that a WEB application framework must be compromised from the outset, including context state management, RESTful and user-friendly URLs, Ajax remoting, and, after enough practical development, Proper exception handling and conventions are better than configurations. To the delight of Java developers, Seam can meet all of these requirements and even meet more requirements. If you are using JSF and have not heard of seam, I strongly recommend that you look at seam's reference documentation (see Resources). The manual that comes with Seam is the best information!

Although Seam is clearly well suited as a complement to JSF, it has been somewhat slighted in a competitive environment. Today's market is awash with a wide variety of WEB application frameworks-including Shale and Struts 2, where newcomers are often not valued and Seam has not yet established itself in the mainstream. Another reason Seam is not catching on quickly is that some of the rumors about the framework have made Java developers less aware of its immediate advantages.

One of the rumors I'm going to crush is that seam is only useful when used with EJB 31, or that you need a EJB3 container to develop your application with seam. In fact, seam's documentation clearly refutes this misconception: "Seam does not require a component to be an EJB, even when there is no container compatible with EJB 3.0." "If you can use Seam only if you are using EJB 3, it's tantamount to saying that you can use Spring only when you are using Hibernate," he said. Although both pairs are highly complementary, each pair is not dependent on each other.

Consideration of the EJB3

As I will explain, Seam extends the default JSF lifecycle through some valuable hook and component management processes. You can also use Seam completely independent of EJB3. But remember, like EJB3, seam relies on the JDK 5 annotation metadata for component declarations, so using Seam requires simultaneous use of a Java 5-compliant JVM. Figure 1 shows the application stack for a Seam POJO implementation:

Figure 1. A Seam POJO application stack

In fact, there are many features of Seam that you can use even if you don't refer to EJB 3 jars or descriptor files at all. When Seam is used with POJO, the framework retains full control of the component instantiation and does not require any specialized configuration. Seam is responsible for most Java 5 annotation processing and does not need to rely on any mechanism in EJB 3. A limited set of annotations that really depend on the EJB3 container are specific to that environment. In some cases, it can be better cost effective to integrate Seam into an IT investment without EJB 3 coupling. How to use Seam depends on your personal preference.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.