blob: cfc9adb2b91c5e4630a9eef7f72bedad8546ebed [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../com.ibm.help.doc/swg_info_common.css" />
<title>Adding and removing JSP templates</title>
<script language="JavaScript">
function popup_window( url, id, width, height )
{
popup = window.open( url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=no,width=' + width + ',height=' + height + ',left=,top=' );
popup.focus();
}
</script><script language="JavaScript" src="help/liveHelp.js"></script></head>
<body id="tsrcedt028"><a name="tsrcedt028"><!-- --></a>
<h1 class="topictitle1">Adding and removing JSP templates</h1>
<div><p>JSP content assist provides several templates, or chunks of predefined
code, that you can insert into a file. You can use the default templates as
provided, customize the default templates, or create your own templates.</p><div class="skipspace"> <p>For example, you may work on a group of JSP pages that should
all contain a table with a specific appearance. Create a template that contains
the tags for that table, including the appropriate attributes and attribute
values for each tag. (You can copy and paste the tags from a structured text
editor into the template's <span class="uicontrol">Pattern</span> field.) Then select
the name of the template from a content assist proposal list whenever you
want to insert your custom table into a JSP file.</p>
<p>To add a new JSP template,
complete the following steps:</p>
</div>
<ol><li class="skipspace"><span>From the <span class="uicontrol">Window</span> menu, select <span class="uicontrol">Preferences</span>.</span></li>
<li class="skipspace"><span>In the Preferences page, select <span class="menucascade"><span class="uicontrol">Web and
XML</span> &gt; <span class="uicontrol">JSP Files</span> &gt; <span class="uicontrol">JSP Templates</span></span>.</span></li>
<li class="skipspace"><span>Click <span class="uicontrol">New</span>. </span></li>
<li class="skipspace"><span>Enter the new template name (a text string) and a brief description
of the template.</span></li>
<li class="skipspace"><span>Using the <span class="uicontrol">Context</span> drop-down list, specify
the context in which the template is available in the proposal list when content
assist is requested.</span></li>
<li class="skipspace"><span>In the <span class="uicontrol">Pattern</span> field, enter the appropriate
tags, attributes, or attribute values (the content of the template) to be
inserted by content assist.</span></li>
<li class="skipspace"><span>If you want to insert a variable, click the <span class="uicontrol">Variable</span> button
and select the variable to be inserted.</span> For example, the <var class="varname">word_selection</var> variable
indicates the word that is selected at the beginning of template insertion,
and the <var class="varname">cursor</var> variable determines where the cursor will
be after the template is inserted in the HTML document.</li>
<li class="skipspace"><span>Click <span class="uicontrol">OK</span> to save the new template.</span></li>
</ol>
<div class="skipspace"><p>You can edit, remove, import, or export a template by using the
same Preferences page. If you have modified a default template, you can restore
it to its default value. You can also restore a removed template if you have
not exited from the workbench since it was removed.</p>
<p>If you have a template
that you do not want to remove but you no longer want the template to appear
in the content assist list, go to the Templates preferences page and uncheck
its check box.</p>
</div>
</div>
<div><p><b class="relconceptshd">Related concepts</b><br />
<a href="csrcedt004.html" title="Structured text editor is any of several text editors that you can use to edit various markup languages such as HTML, JavaScript, or XML.">Structured text editors for markup
languages</a><br />
</p>
<p><b class="reltaskshd">Related tasks</b><br />
<a href="tsrcedt027.html" title="Content assist provides templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing markup language
templates - overview</a><br />
<a href="tsrcedt024.html" title="HTML content assist provides several templates, or chunks of predefined code, that you can insert into a file. You can use the default templates as provided, customize the default templates, or create your own templates.">Adding and removing HTML templates</a><br />
<a href="tsrcedt029.html" title="XML content assist provides a comment template, a chunk of predefined code that you can insert into a file. You can use the default template as provided, customize that template, or create your own templates.">Adding and removing XML templates</a><br />
<a href="tsrcedt000.html" title="You can edit text coded in markup languages with a structured text editor. This is a generic term for several editors that you can use to edit any of several markup languages such as HTML or XML.">Editing text coded in markup languages
- overview</a><br />
</p>
</div><p>
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.
</p>
</body>
</html>