ergJSPTaglibTags Readme
This plugin helps with the use of JSP custom tags in JSP pages.
The plugin dynamically provides the available JSP custom tags for the Taglib Directives
being used in the JSP page in the right-click context menu.
The collection of Taglib Directives that are support can be updated in the
HTML-Kit/Plugins/Config/ergJSP directory.
The following are the Taglib Directives that are support by this plugin as is:
-
<%@ taglib uri="/tags/core" prefix="c" %>
-
<%@ taglib uri="/tags/fmt" prefix="fmt" %>
-
<%@ taglib uri="/tags/sql" prefix="sql" %>
-
<%@ taglib uri="/tags/xml" prefix="x" %>
-
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
-
<%@ taglib uri="/tags/struts-html" prefix="html" %>
-
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
-
<%@ taglib uri="/tags/struts-nested" prefix="nested" %>
-
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
-
<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
-
<%@ taglib uri="/tags/struts-html-el" prefix="html-el" %>
-
<%@ taglib uri="/tags/struts-logic-el" prefix="logic-el" %>
-
<%@ taglib uri="/tags/pager" prefix="pg" %>
-
<%@ taglib uri="/tags/sofia" prefix="salmon" %>
The plugin ergJSP has actions that help to insert the above Taglib Directives
into a JSP page and you can get this plugin from the HTML-Kit Plugins Download page.
Note: The Taglib Directive URI is used as the link to the tag library descriptor (TLD) file to
be parsed for the JSP custom tags. If you are using a different URI for one of these Taglib Directives,
then you will need to follow the instructions Changing a Taglib Directive URI to
modify the URI, so that the plugin can find the JSP custom tags.
Note: If you replace one of the supplied tag library descriptor (TLD) files with a newer version,
then this plugin will recognize it and automatically update its JSP custom tags database with the new
version of the tags. But if you would like to add a new TLD file that is not supported by this plugin
at the moment, then follow the instructions Adding a New Tag Library Descriptor (TLD)
to add it to the JSP custom tags database.
How to use this plugin:
-
Have an editor window open and active with the JSP page that has 1 to 12 of the
supported Taglib Directives.
-
This plugin has no action button on any of the visible action bars, but is activated
by right clicking in the editor to open the context pop-up menu.
-
Place the cursor where you would like to insert a JSP custom tag from one of the
Taglib Directives defined in the JSP page.
-
Right click in the editor to open the context pop-up menu. Note: The first time
usually takes longer to open the context pop-up menu then subsequent times.
-
If the Taglib Directives defined in the JSP page are found in this plugins database,
then new menu options are dynamically added for each one that start with "JSP Taglib Prefix:".
-
Move the mouse pointer over the "JSP Taglib Prefix:" menu option that has the Taglib Directive
prefix for the JSP custom tag that you need to insert and a list of the available JSP custom
tags for that Taglib Directive prefix will be displayed.
-
Select the desired JSP custom tag from the list and it will be inserted at the cursor in the JSP
page with the required attributes first and the optional attributes in []. Note: Remember to
remove the [] and any unused optional attributes from within the JSP custom tag.
How to extend this plugin:
After installing this plugin the directory HTML-Kit/Plugins/Config/ergJSP is created with the
following files:
web.xml, jspTaglibs.properties, c.tld, fmt.tld, pager-taglib.tld, sofia.tld, sql.tld,
struts-bean-el.tld, struts-bean.tld, struts-html-el.tld, struts-html.tld, struts-logic-el.tld,
struts-logic.tld, struts-nested.tld, struts-tiles.tld, and x.tld
The web.xml file is used to determine which tag library descriptor (TLD) file is parsed
for the JSP custom tag definitions. You might have to modify this file to extend this plugin to
support other JSP custom tag libraries or different Taglib Directive URIs.
The jspTaglibs.properties file is the hard drive version of the database of JSP custom
tags that is dynamically maintained in the Windows registry. You will not want to modify this
file, because the plugin will do it for you, but you can look at it to see which JSP custom
tags are being support; and if their definitions are correct.
The TLD files are the JSP custom tag library descriptor files that contain the definitions
that are used to create the database and context pop-up menu options.
-
Adding a New Tag Library Descriptor (TLD)
-
Copy the new TLD file into the directory HTML-Kit/Plugins/Config/ergJSP.
-
Edit the web.xml file.
-
Add a new <taglib> element as follows:
<taglib>
<taglib-uri>/tags/your_new_tld_uri</taglib-uri>
<taglib-location>/WEB-INF/your_new_tld.tld</taglib-location>
<taglib-prefix>optional</taglib-prefix>
</taglib>
Note: The <taglib-prefix> element is optional, not used by this plugin (but another
plugin that I am playing around with), and really not part of the web.xml specification, so if
you reuse any of these <taglib> element entries in a real web.xml make sure to remove
this element or you will get validation errors.
-
Make sure that the "/tags/your_new_tld_uri" value is the same URI that you use in the Taglib
Directive in the JSP pages.
-
The "/WEB-INF/your_new_tld.tld" is the file name of the new TLD file that was copied in a
previous step and it should be prefixed with "/WEB-INF/", but does not have to for this
plugin to work.
-
Save the web.xml file changes.
-
Changing a Taglib Directive URI
-
Edit the web.xml file.
-
Find the element <taglib-location> that has the tag library descriptor (TLD) file
name that has the URI that needs to be changed.
-
Change the value for the element <taglib-uri>, which was found with the
<taglib-location> element, to the URI that is needed for the TLD file.
-
Save the web.xml file changes.