站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Servlets and JavaServer Pages: The J2EE Technology Web Tier

Servlets and JavaServer Pages: The J2EE Technology Web Tier

[ directory ]JSP. 2.0 Expression Language Chapter6.        JavaServer Pages Standard Tag Library

Summary

JavaBeans are a simple but helpful addition to JSP. As used by JSP, a JavaBean is really nothing more than a fancy name for a way to code a Java class. By following certain design restrictions, it is easy to create a set of JSP actions that can manipulate and use any of those classes. JavaBeans are an example of a set of design restrictions, primarily get and set methods, and the JavaBean standard actions are available for use with JSP.

The JSP EL is another helpful feature of JSP. The JSP EL provides an intuitive, non-Java method of writing expressions that do simple logic and access scoped variables. By itself there is little the JSP EL does, but the JSP EL is commonly used with custom tags and popular design patterns. Throughout the rest of the book the JSP EL will be appearing often; note how the JSP EL is used in examples and think about how it complements the JSP.

The final point presented in this chapter is that there are several good uses for the JSP EL. Simplifying JSPremoving classic JSP expressions and JavaBean actionsis a good example, and using JSP EL expression with JSP in XML syntax is almost required. However, the JSP EL in some respects eliminates the need for coding JavaBeans. Understand the technique, as it can simplify Web Application development.

[ directory ]JSP. 2.0 Expression Language Chapter6.        JavaServer Pages Standard Tag Library