Release 1.x‎ > ‎Development‎ > ‎NetBeans‎ > ‎

Samples Taglib

The Samples-Taglib package contains Java Server Pages (JSPs) that demonstrates the use of Project OpenPTK's Consumer Tier custom JSP Taglib.

New Project


  1. From the File menu, select New Project
  2. From the Categories Pane, select "Web"
  3. From the Projects Pane, select "Web Application with Existing Source"
  4. Click the "Next >" button

Add Existing Sources


  1. Select the Folder that contains the Web Application source files.
  2. Click the "Browse" button to the right of the Location: field
  3. From the browse panel, locate the "web" folder that's under the "Samples/Taglib" folder. These folder are found in the ${PTK_HOME} folder.
  4. Select the "web" folder and click "open"
  5. Set the Project Name to "Samples-Taglib"
  6. Set the Project Folder to be under ${NB_HOME}. Use the name "Samples-Taglib" /work/Software/netbeans/openptk/Samples-Taglib
  7. Select the deployment server. This document uses Glassfish v1. You must have a configured web container.
  8. Select "Next >"

Existing Sources and Libraries

We will not be making any changes to this part of the set-up.
Click the "Finish" button

Verify New Project

After the Web Application has been created, verify it's components. Select the "Projects" tab and the "Files" tab. Explore tabs to verify the components.
See the images below:

Resolve Dependancies

Configure this Project use the following:

  • Projects:
    • OpenPTK-Framework
    • OpenPTK-Service-SPML
    • OpenPTK-Service-JNDI
    • OpenPTK-Service-JDBC
    • OpenPTK-Consumer-Taglib
  • OpenSPML JAR files:
    • openspml.jar
    • soap.jar
    • mail.jar
    • activation.jar
    • mysqljdbc.jar
  • OpenPTK Configuration files

  1. Select the "Samples-Taglib" Project, from the Projects panel, if it is not already selected.
  2. From the "File" menu, select the menu item "Samples-JavaAPI" Properties
  3. From the Categories pane, Select the Build -> Packaging item
  4. From the WAR Content: pane, click the "Add Project ..." button.
    1. Using the "Add Project" panel, locate the "OpenPTK-Framework" NetBeans Project. For this document, it is located in the ${NB_HOME} directory.
    2. Add the following Projects: OpenPTK-Framework, OpenPTK-Service-SPML, OpenPTK-Service-JNDI, OpenPTK-Service-JDBC, OpenPTK-Consumer-Taglib
    3. Set the "Path in WAR" value to: /WEB-INF/lib
  5. From the WAR Content: pane, click the "Add File/Folder ..." button.
    1. Using the "Add File/Folder" panel, locate the libraries that need to be included. These are in ${PTK_HOME}/lib.
    2. Add the following JAR files: openspml.jar, soap.jar, activation.jar, mail.jar, ldapbp.jar, mysqljdbc.jar Note: If deploying to a J2EE container, activation.jar and mail.jar are not needed.
    3. Set the "Path in WAR" value to: /WEB-INF/lib
  6. From the WAR Content: pane, click the "Add File/Folder ..." button.
    1. Using the "Add File/Folder" panel, locate the OpenPTK confoguration files that need to be included. These are in ${PTK_HOME}/projects/OpenPTK.
    2. Add the following files: openptk.xml and openptk.xsd
    3. Set the "Path in WAR" value to: /WEB-INF/classes
  7. Click the "OK" button on the Project Properties panel.

Clean and Build

You can now build the project. Select the "Samples-Taglib" Project from the Projects panel. Right-click on the selected project and select "Clean and Build". The Project should build successfully.

Deploying and Running

If you are connected to the Internet, you can test the sample taglib JSPs. The default configuration for Project OpenPTK is setup to access a user repository (via SPML) hosted on http://www.openptk.org
Right-click on the "Samples-Taglib" project and select "Undelpoy and Deploy".
Right-click on the "Samples-Taglib" project and select "Run".