You use the include tag to read an internal or external resource and store the result in a scoped object. The attributes of the include tag are presented in Table 8.8.
| Attribute | Description |
|---|---|
| anchor | An optional anchor ("#xxx") to be appended to the generated hyperlink. Specify this value without a # character. |
| forward | The logical name of a forward destination inside the global-forwards element in the Struts configuration file that contains the URL of the resource to be included. |
| href | The absolute URL of the resource to be included. |
| id | A required attribute that specifies the name of the scoped variable that will be created to reference the object that contains the specified Web resource. |
| page | A module-relative URI of the Web application resource to be included. |
| transaction | A value of true indicates that the current transaction control token will be included in the generated URL. |
Table 8.8: The include tag’s attributes.
For example, the following include tag reads the footer.jsp page and stores the content in the footer scoped object.
<bean:include id="footer" name="/jsp/footer.jsp"/>
The include tag does not print the resource. To achieve this, you need to use the write tag, such as the following.
<bean:write name="footer"/>