„The JavaServer Faces (JSF) technology provides standard APIs and tag libraries needed by Java developers that build web-based user interfaces. Craig McClanahan, the author of the Apache Struts framework, co-leads the JSF project at Sun. This will ensure an easy migration from the popular Apache project to the JSF standard. Like the Struts framework, JSF defines a set of JSP tags that generate HTML form elements that can be bound to JavaBean properties. From the application developer’s perspective, the two frameworks are similar, but JSF will probably get more support from tool developers, because it is a Java standard. In the future, all J2EE application servers might actually be required to support JavaServer Faces.
Sun has recently released its Java Web Services Developer Pack 1.2, which includes a reference implementation (Early Access 4 — EA4) of the JSF Specification (Version 1.0, Public Review Draft 2). The EA4 version implements new features such as actions, managed beans, and navigation rules. This article focuses on these new features and shows how to take advantage of JSF in order to build forms, validate user input, and bind user interface components to JavaBean properties.
This article contains a web application made of four main components. A JavaBean class (PBean.java) acts as a data model, holding some text and its attributes: font, size, color, alignment, etc. A JSF-based form (edit.jsp) allows users to provide values for the properties of the JavaBean. Another Java class (PBuilder.java) generates an HTML paragraph with the given text and attributes. Finally, a JSP page (view.jsp) shows the generated paragraph.“

ONJava.com — Using JSF

ONJava.com — Using JSF

Von admin

Ähnlicher Beitrag

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert