Chapter 11. Invoking Java Code with JSP Scripting Elements

Topics in This Chapter

  • Static vs. dynamic text

  • Dynamic code and good JSP design

  • The importance of packages for JSP helper/utility classes

  • JSP expressions

  • JSP scriptlets

  • JSP declarations

  • Servlet code resulting from JSP scripting elements

  • Scriptlets and conditional text

  • Predefined variables

  • Servlets vs. JSP pages for similar tasks

This chapter discusses the “classic” approach to invoking Java code from within JSP pages. This approach works in both JSP 1 (i.e., JSP 1.2 and earlier) and JSP 2. Chapter 16 discusses the JSP expression language, which provides a concise mechanism to indirectly invoke Java code, but only in JSP 2.0 and later.

Creating Template Text

In most cases, a large percentage of your ...

Get Core Servlets and JavaServer Pages™: Volume 1: Core Technologies, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.