29.01.2013 Views

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

WebSphere Application Server - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

One consequence of the fact that the file referenced within the include directive is<br />

included during the translation phase is that subsequent changes to the included<br />

file will not be picked up by the Web container on subsequent invocations of the<br />

JSP. The changes will only be visible when the JSP containing the include<br />

directive is itself updated, or its JSP page compilation class is deleted, forcing the<br />

translation phase to be carried out. If this behavior is not desirable, you can use<br />

the include action tag instead (see “The include action tag” on page 255).<br />

Example 8-4 shows an example of using an include directive.<br />

Example 8-4 file2.jsp<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

File2.jsp<br />

<br />

<br />

<br />

Place File2.jsp <br />

<br />

<br />

The contents of the file to be included, file1.jsp, are shown Example 8-5.<br />

Example 8-5 file1.jsp<br />

<br />

<br />

BODY><br />

First File Contents.<br />

<br />

<br />

Chapter 8. Working with JSPs 251

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!