Create JSF-like components, using JSP tag files
Learn how to use deferred values and deferred methods in custom JSP tag

JavaServer Pages (JSP) and JavaServer Faces (JSF) used to have different variants of the Expression Language (EL). Their unification in JSP 2.1 opened new possibilities, allowing you to use deferred values and deferred method attributes in your custom JSP tags. This article shows how to develop Java™ Web components based on JSP tag files, which are much simpler and easier to build than the JSF components.

JSP and JSF are the most important Java standards that we use today for building Web applications. The philosophies of these two technologies are quite different, however. With JSP, the underlying mechanisms are simple, you control what is happening, and you have the freedom to do things how you want. JSF adds some complexity and processing overhead, but the application model is standardized, which means tools can do more for you, vendors can provide component libraries, and developers can focus on building applications.

As Parts 2 and 3 of this series demonstrated, you don’t really need a complex framework for building Web forms. If you like simplicity or if you need to develop a Web application quickly, you can use the JSP Standard Tag Library (JSTL) in combination with tag files and dynamic attributes. You’ll be able to customize your components very easily, controlling the HTML output and the HTTP requests.

Using the JSF framework together with a good component library may be the right choice if you are building a sophisticated Web application. Because no Web framework can satisfy every need of every application, you might still have to build a few components of your own. In this case, you can use the techniques presented in this article to create JSF-like components without using the JSF APIs. You’ll be able to mix your non-JSF components with the JSF components in the same Web page and you’ll avoid much of the JSF complexity

Download pdf Ajax and Java development made simpler Part 4