dsp:include lets you embed a page fragment in a JSP just as you can with the JSP include tag. It is also possible to pass page parameters from the parent page to the included page using this tag.

For information on other methods for embedding documents, see Embedding Pages.

Attributes

EmbeddedPage:srcorpage(Required)

You must use one of these attributes to specify the page to append to the parent page.

Attribute

Description

src

Path and file name. Supports pages in other Web applications as long as they are configured appropriately in the web.xmlatg.dynamo.contextPaths parameter. See Absolute URLs for a detailed discussion.

page

Path and file name. Resolves relative paths using the current page as a starting point. Resolves absolute paths using the Web application root as a starting point by prepending the request object’s context root to the specified value.

OtherWebApplications:otherContext

The otherContext attribute lets you include pages used in other Web applications by specifying an alternate context path, without requiring the context path referenced to be included in the web.xml.

ClearCache:flush

The flush attribute determines whether, in the parent page, buffered data should be written to parent bodyContent tags and flushed from the buffer when the dsp:include tag executes. In general, you should set this attribute to true. Set it to false if you do not want to flush the buffer. If you do not explicitly set this attribute, a flush is done automatically.

Settings flush="false" does not guarantee that the JSP buffer is not flushed. If the buffer happens to fill during the rendering of a page, the underlying application server flushes the buffer. Because of this behavior, you should always put redirect statements near the top of a page and before any dsp:include or jsp:include tags.

Note that if flush=true or is not set, your http response is committed, and therefore you cannot use a redirect on the page after the include. If flush=false, you can redirect the page.

Also note that the JSP spec does not allow redirecting from an included page. For example if page Alpha.jsp includes page Beta.jsp, no redirect is allowed from Beta.jsp.

AcceptableStaticCharacters:staticcharset

The staticcharset attribute lets you specify a preferred character set used when bytes are converted to characters. If you do not include this attribute in your page, the default, ISO-8859-1, is assumed.

Example

<dsp:include otherContext="/myOtherWebApp"
page="/SophomoreRegistration.jsp"/>

The SophomoreRegistration.jsp page is embedded in the parent page. Because the flush attribute is not set, the default, false, is used.

For more information about using dsp:include, see Embedding Pages.

 
loading table of contents...