Written by Chris Schalk, Oracle Corporation
Even though JDeveloper 10g integrates many widely popular and powerful JSP tag libraries such as the JSP Standard Tag Libraries (JSTL) and the Struts tag libraries, it is also possible to integrate externally developed JSP tag libraries into JDeveloper's development environment. This How To steps through the process of downloading an externally developed custom tag library and integrating into JDeveloper's development environment. I will also show some of the cool support such as tag completion and rendered tags in the JSP visual editor.
For this exercise I will download the Jakarta "Input" tag library which can be found at:
Now it's time to integrate out external tag library into JDeveloper. This is a 2 step process. First we'll create a "Input Taglib" system library which is simply a reference to the location of the tag library's jar file(s), and then we'll add the Input tags themselves to the Component Palette.
Register the taglib descriptor file (TLD) with JDeveloper and add the tags to the Component Palette.
-Again, select Tools-> Manage Libraries
-This time select the "JSP Tag Libraries" tab and click "New"
-Specify the following
TLD File: D:\input_taglib\taglibs-input.tld (Use the Browse button.)
Libraries: Input Taglib (Use Browse button and select your "Input Taglib" library created in the previous step.)
URI: http://jakarta.apache.org/taglibs/input-1.0 (should be autofilled)
Prefix: input (You can define this yourself.)
Leave the "Execute tags in visual editor" checkbox unchecked and click "Ok".
Note: By leaving the "Execute tags..." checkbox unchecked, you are turning off the JSF tag visualization feature. This feature allows you to actually execute the tag when it's viewed in the JSP visual editor to provide a more intuitive rendered experience. In practice it is best to start out with this turned off, so you can work with tags in their non-runtime rendered, iconic state and then later, turn on the rendering to get a better view of the application.
The next step is to add the tags to the palette. (Note: These next steps are simplified in the production version of 10g.)
On the main menu select, "Tools->Configure Palette..."
Under the "Pages:" window on the left, click "Add..".
Name the new Component Palette page "Input Tags" and select "jsp" as the page type.
In the same dialog, click "Add..." under the "Components" window on the right side. These are the actual components (in our case, tags) which will appear on the new Palette page.
In the Taglib dialog, select the "Input" tag library in the tree and click "Ok". A dialog will appear, "Install all JSP(s) tags?", click "Yes" to install them onto the Palette.
Click "Ok" to dismiss the Palette configuration dialog. Now when you edit JSP pages, you will see your new "Input Tags" Component Palette Page.
That's it! You're done! You can now use the Input tags in JDeveloper.
Now we'll use the new Input tags in a simple application.
Let's start by creating an application Workspace
Now that we've added the JSP tag library to JDeveloper we also get some helpful features in the Code Editor as well such as JSP taglib Code Completion. Let's try this out..
As you can see, it is possible to integrate externally developed JSP tag libraries into both JSP visual and coding development environments in JDeveloper.
Have fun integrating other JSP tag libraries into JDeveloper!
Discuss this How To in this Discussion Thread on OTN Forums:
For further reference: