Advanced Customization > Info*Engine User’s Guide > Info*Engine Custom Tag Reference > Info*Engine Tags > Core Library Tags > init
  
init
The init tag supplies the initialization for a unit. The code between the start and end init tags executes first in a unit each time the unit is executed. Using an init code block allows you to identify specific code that always executes first when the unit is executed, even if the code block is not at the beginning of the unit. For example, in the initialization code, you could save the initial state of any objects that are manipulated in the unit. Then, if an error occurs in the body of the unit, the failure block could restore the objects to this initial state.
If a failure occurs in an init tag block, the error is returned to the code block from which the unit was executed. For example, assume that a JSP page has one unit nested in another unit as follows:
<!-- Top of page -->
:
:
<!-- First Unit -->
<ie:unit>
<ie:init>
<!-- Initialization of First Unit -->
<!-- Errors occurring here are passed back to the page -->
</ie:init>

<!-- Body of First Unit -->
<ie:webject > … </ie:webject>
<ie:webject > … </ie:webject>

<!-- Nested Unit -->
<ie:unit>
<ie:init>
<!-- Initialization of Nested Unit -->
<!-- Errors occurring here are passed back to first unit -->
</ie:init>

<!-- Body of Nested Unit -->
<ie:webject > … </ie:webject>
<ie:webject > … </ie:webject>

<ie:failure>
<!-- Nested Unit failure processing accessed when -->
<!-- there is an error in the body of the nested unit -->
</ie:failure>

<!-- End of Nested Unit -->
</ie:unit>

<ie:failure>
<!-- First Unit failure processing accessed when -->
<!-- there is an error in the body of the first unit-->
</ie:failure>
<!-- End of First Unit -->
</ie:unit>

<!-- Page Error Processing-->
:
:
<!-- End of Page-->
If the initialization of the nested unit fails, the failure is recorded as an error in the body of the first unit. If the initialization of the first unit fails, this error is processed by the page, which may automatically send it to its error page.
Scriptlets that are nested in unit, init, success, and failure tag blocks are not processed on JSP pages the same way they are processed in the Info*Engine task processor. Use the following guidelines to determine when you can nest scriptlets in these tags:
You can nest scriptlets within tag blocks in a standalone task.
You should not nest scriptlets in any tag block on a JSP page. Instead, create standalone tasks that contain the scriptlets. You can execute these tasks from the JSP page by using the Info*Engine task tag.
For more information, see Scriptlets.
* 
Embedded HTML is not supported within init tags in JSPs.
You nest this tag in unit tag blocks.
You can nest multiple webject, task, unit, and parallel tags in this tag block.
Syntax
<ie:init>
.
. (webject, task, unit, or parallel tag blocks)
.
</ie:init>