[ Team LiB ] Previous Section Next Section

An Overview of JSP Directives

The JavaServer Pages specification contains four different types of tags that start with the characters <%. The plain <% tag begins a block of Java code. The <%! tag begins a declaration of class attributes or methods. The <%= tag inserts the result of a Java expression in the output. The final <% tag is the directive tag, which is <%@. There are currently three directives in the JSP specification:

  • page

  • include

  • taglib

The page directive is a catchall for various page options that don't really warrant their own directives. The include directive enables you to include other files at compile time as opposed to runtime. The taglib enables you to include an external library of custom JSP tags so you can expand the core set of tags recognized by JSP. The taglib directives will be covered in more detail in Hour 16, "Extending JSP with New Tags."

    [ Team LiB ] Previous Section Next Section