Your First Cup: An Introduction to the Java EE Platform

ProcedureAdding Tag Libraries to the XHTML Files

Modify greeting.xhtml to include the components tag library.

  1. In the firstcup project open greeting.xhtml by double-clicking the file name under Web Pages in the left pane.

  2. Add the components tag library to the <html> tag.

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:fc="http://java.sun.com/jsf/composite/components">

    The components resource library is referred to by the fc prefix. The JSF Core and HTML Render Kit tag libraries are also used in greeting.xhtml.

  3. Add a title directly after the <html> tag.

    <head>
        <title>Firstcup Greeting Page</title>
    </head>
  4. Select File -> Save.

  5. Open response.xhtml and add the following title:

    <head>
        <title>Response Page</title>
    </head>
  6. Select File -> Save.