taglib-bean

来源:互联网 发布:twizzlers扭扭糖淘宝 编辑:程序博客网 时间:2024/04/30 09:54

The <bean:define> tag differs from <jsp:useBean> in several ways, including:

  • Unconditionally creates (or replaces) a bean under the specified identifier.
  • Cancreate a bean with the value returned by a property getter of adifferent bean (including properties referenced with a nested and/orindexed property name).
  • Can create a bean whose contents is a literal string (or the result of a runtime expression) specified by the value attribute.
  • Does not support nested content (such as <jsp:setProperty> tags) that are only executed if a bean was actually created.

If you use another tag to create the body content (e.g. bean:write),that tag must return a non-empty String. An empty String equates to anempty body or a null String, and a new scripting variable cannot bedefined as null. Your bean must return a non-empty String, or thedefine tag must be wrapped within a logic tag to test for an empty ornull value.

原创粉丝点击