O'Reilly logo

JavaServer Faces by Hans Bergsten

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Pure HTML Templates with XML View Definition Files

When you use JSP pages to create JSF views, you must use special elements (the JSF custom action elements as well as standard JSP directives and action elements). To look at the result, you need to let a web container process the page first instead of just opening the page in a browser. In addition, plain HTML-based development tools are not always able to deal with the special elements. Developing the views as regular Java classes—as described in the previous section—may be familiar to old GUI application gurus, but it doesn’t work well when nonprogrammers develop the user interface layout.

The Apache Tapestry (http://jakarta.apache.org/tapestry/) open source web interface framework uses an approach in which each page is described by a combination of a page specification file, a Java class similar to a JSF “glue class” or “backing bean,” and a plain HTML template file. The page specification file defines Tapestry components and binds them to elements in the HTML template identified by special ID attributes and to properties of the Java page class. This means that people skilled in user interface design and experienced with HTML, CSS, and so on, can develop the user interface with standard HTML development tools—they don’t have to learn another set of special markup elements or worry about EL expressions and request processing lifecycles. Java programmers develop the page classes and the business logic classes, and tie the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required