Configuring a yFiles Ajax Project with Netbeans

This step-by-step guide explains how to setup a Netbeans project for running and debugging the yFiles AJAX demo web application with Netbeans.

The guide refers to the Netbeans IDE release 6.9.1. The configuration process can be different for other Netbeans releases. Note that only the "Java" and "All" Netbeans bundles support the "Java Web and EE" technologies that are required for creating a web application project as explained below.

  1. Create a new "Java Web" project:

    1. Choose File > New Project… to start the project configuration.
    2. In the "Categories" panel, select "Java Web"
    3. In the "Projects" panel, select "Web Application with Existing Sources"
    4. Hit "Next >"
    Create a new Java Web Project
  2. Select the name and location:

    1. As "Location", select the root folder of your yFiles AJAX distribution.
    2. As "Project Name", enter "yFiles AJAX"
    3. Leave the "Project Folder" as is, such that it is the same folder as in the "Location" field.
    4. Hit "Next >"
    Select the name and location
  3. Confirm the build file path:

    1. If there is a dialog that asks about the name of the auto-created Ant build file, just confirm the suggested name by clicking "Ok".
    Confirm build file
  4. Configure the server:

    1. Configure the servlet container that should be used to run the web application. In this example, we are using the Glassfish server that is bundled with Netbeans. You may of course configure your preferred server here, e.g. a local Tomcat installation.
    2. Hit "Next >"
    Configure the server
  5. Configure the existing sources and libraries:

    1. As "Web Pages Folder", select the demos/web-content/ sub folder of the yFiles AJAX distribution.
    2. As "WEB-INF Content", select the demos/web-content/WEB-INF/ sub folder of the yFiles AJAX distribution.
    3. As "Libraries Folder", select the lib/java/ sub folder of the yFiles AJAX distribution.
    4. In the "Source Package Folders" panel, add the demos/src sub folder if it is not chosen as default.
    5. If your Servlet Container supports (at least) the Java Servlet Specification 3.0, you can also add "demos/src-jee6" as an additional Java source folder.
    6. Hit "Finish". Note that although the configuration wizard finishes with this step, additional resource folders for the web application have to be configured in the next step.
    Configure the existing sources and libraries
  6. Configure additional web application resources:

    1. In the project properties, select Build > Packaging.
    2. Select "Add File/Folder" and add the lib/javascript sub directory of the yFiles AJAX distribution. Enter "javascript" in the corresponding "Path in WAR" field.
    3. Select "Add File/Folder" and add the lib/resources sub directory of the yFiles AJAX distribution. Enter "resources" in the corresponding "Path in WAR" field.
    4. Select "Add File/Folder" and add the yFiles AJAX license file (yfiles-ajax-license.xml). Enter "WEB-INF" in the corresponding "Path in WAR" field.
      As an alternative to the license file deployment, the xml license data can also be specified programmatically. Please see the corresponding section of the developer's guide for details.
    Configure additional sources and libraries
  7. You can now run/debug the project in Netbeans, accessing the yFiles AJAX web applications on localhost
    (e.g. http://localhost:8080/yfiles-ajax/).

Copyright © 2006-2013 yWorks GmbH. All Rights Reserved.