Advanced Customization > Info*Engine User’s Guide > Info*Engine Custom Tag Reference > Directives
  
Directives
Directives provide global information that is conceptually valid independent of any specific request received by the JSP page or by the standalone task. For example, a directive is used to define a prefix that is required for Info*Engine custom tags.
You can use the following directives on JSP pages and in standalone tasks:
The page directive defines the general characteristics of a JSP page.
The taglib directive performs the following actions:
Declares that the page or task uses a tag library.
Uniquely identifies the tag library using a URI.
Associates a tag prefix that distinguishes usage of the actions in the library.
page Directive
The page directive defines the general characteristics of a JSP page. The page directive is a standard JSP directive and is also used in standalone tasks. You include the page directive as the first tag on an Info*Engine JSP page and the first line in a task file.
JSP Use
Use this directive to specify the characteristics of the page, such as:
Identify the Java language used in scripts on the page
Specify the MIME type and character encoding
Specify the page scope
Import any class files or packages needed for the page
Determine what page is displayed for errors
Identify the page as the error page
Standalone Task Use
The task compiler recognizes a standard page directive, but only uses the import attribute for importing the necessary class files and the access attribute for determining how a task can be invoked.
* 
The access attribute is accepted only by tasks, not JSPs.
Tag Syntax for Common Page Characteristics
<%@page language="java"
session="boolean"
import="list_of_classes"
contentType="mimeType [;charset=characterSet]"
errorPage="error_page_url"
isErrorPage="boolean"
access="http|soap|internal"%>
Attribute Descriptions
Required attributes: language
access
A list of access methods acceptable to an Info*Engine task. The possible values are:
internal — The task is invoked by callers internal to the Windchill VM. No external clients are allowed to invoke a task. This value is implicit.
soap — The task is called by SOAP clients.
http — The task is called by raw HTTP clients through the IE servlet.
* 
Windchill uses internal task access by default. Therefore, you must explicitly specify task access for tasks that are intended to be called by external clients.
The access attribute is accepted only by tasks, not JSPs.
Values can be specified as a pipe-separated list. For example, use access=“http|soap” for tasks that can be invoked using a SOAP client or the IE servlet.
* 
In situations where several tasks compose a service, you can specify a value for the subdirectory to avoid editing each individual task. To do this, update the .delegateInfo file in the subdirectory where your tasks are installed. For example:
<Windchill>/tasks/com/ptc/windchill/ws/.delegateInfo
The .delegateInfo file is a simple Java properties file, so in this case you would not use quotes when specifying access. For example, access=soap.
contentType
The MIME type and character encoding the JSP file uses for the response it sends to the client. You can use any MIME type or character set that is valid for the JSP. The default MIME type is text/html and the default character set is ISO-8859-1.
errorPage
Defines the URL to the error page for the current page. Any errors not caught on the page cause the page named in this attribute to execute. The error page named must include the isErrorPage="true" attribute in its page directive.
import
Identifies the Java class files or packages that are made available to the scripting language that is on the page or in the task. You can specify a comma-separated list containing either fully qualified type names or package names followed by “*”. Specifying a package name makes all public types in the package available.
isErrorPage
Indicates whether the current page is used as the target of another JSP page errorPage attribute. To use the current page as an error page for another page, set this attribute to true. By default, this attribute is set to false.
language
Defines language that is used in the page. The value of this attribute must be java.
This attribute is required.
session
Sets the scope for the page. To set the page scope to the session, set the session attribute to true. To set the page scope to the current page, set the session attribute to false.
This is an optional attribute. If you omit this attribute, the page scope is the session.
Example
The following page directive sets the language to Java, sets the scope of the page to the session, imports the Info*Engine factory and object packages, and sets the error page to IEError.jsp:
<%@page language="java" session="true"
import="com.infoengine.object.factory.*,
com.infoengine.object.*"
errorPage="IEError.jsp"%>
For additional information about error pages, see Catching Exceptions.
taglib Directive
The taglib directive declares that a JSP page or Info*Engine standalone task uses custom tags defined in a tag library. You must put this directive before any lines that use the custom tags in the library.
Tag Syntax
<%@taglib uri="ie_uri" prefix=“ie_prefix" %>
Attribute Descriptions
Required attributes: prefix and uri
prefix
Defines the prefix that distinguishes tags provided by a given tag library from those provided by other tag libraries. If you specify multiple taglib directives, each prefix must be unique.
This attribute is required.
uri
Identifies an Info*Engine tag library, where the URI is:
http://www.ptc.com/infoengine/taglib/
followed by the tag library name.
This attribute is required.
Example
The following taglib directive declares that the page contains custom tags from the Info*Engine core tag library and that the tags use the ie prefix:
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core"
prefix="ie" %>