corner imagecorner image
IDEPlatformPluginsDocs & SupportCommunityPartners

Adding Support For A Web Framework

This document provides a general description of how to add support for a web framework in NetBeans IDE. The steps provided show how you can add support by installing a web framework plugin into the IDE using the Plugin Manager. After you install the plugin you will be able to select the framework in the New Project wizard when you create a web project. The new web project is then created containing the necessary infrastructure specific to the chosen framework.

The easiest way to add support for a particular web framework is by installing a NetBeans plugin using the IDE's Plugin Manager. This is convenient if you have Internet access while working in the IDE. Plugins for many web frameworks are also available via the NetBeans Plugin Portal. If you do not have regular Internet access, you can download the plugin modules (e.g., from the Plugin Portal) when you have the opportunity, then install them into the IDE at a later time.

Note: Support for the JavaServer Faces and Struts and Spring frameworks is included in the IDE by default.

Some of the currently available plugins include the following:

Framework Plugin Location Plugin Portal Location
Google Web Toolkit https://gwt4nb.dev.java.net http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=716
jMaki http://ajax.dev.java.net/jmaki-plugin.html  
Wicket https://nbwicketsupport.dev.java.net http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=3586
Facelets   http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=1546
Tapestry https://nbtapestrysupport.dev.java.net http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=2602

Contents

Content on this page applies to NetBeans IDE 6.x

To complete this tutorial, you need the following software and resources.

Software or Resource Version Required
NetBeans IDE, Java bundle 6.7, 6.8, or 6.9
Java Development Kit (JDK) 6

Notes:

  • The Web and Java EE installation enables you to optionally install the Apache Tomcat 6.x servlet container, and the GlassFish server 2.1 or 3.0.1. Depending on the framework you plan to use, you must install one of these to work through this tutorial.
  • You must also have an Internet connection to download necessary plugins and/or access them via the IDE's Plugin Manager.

Installing a Framework Support Plugin

You can add support for a specific framework by installing the appropriate framework support plugin into the IDE. To do so, you can either download the plugin modules from an external site, then point the Plugin Manager to their location on your computer, or, if the plugin is maintained by an update center, you can register the update center with the IDE's Plugin Manager, then download and install directly through the Plugin Manager.

Installing via an Update Center

If the framework support plugin is maintained by an update center, you should consider installing the update center into the IDE. This enables you to then install the framework support plugin directly through the Plugin Manager. Also, the Plugin Manager logs any updates made to plugins maintained by update centers, providing you with a simple and effective means of keeping installed plugins up-to-date.

Various update centers are already registered with the IDE by default. For example, if you open the Plugin Manager (Tools > Plugins), then choose the Settings tab, you will see a list of the update centers that are currently registered. If you want to register a new update center, you would click the Add button from this panel, and fill in details in the Update Center Customizer that displays.

Taking jMaki as an example, the framework support plugins are already included in the official NetBeans update center, which is registered in the IDE's Plugin Manager by default. Because the plugins are included, they are available for download and installation under the Available Plugins tab in the Plugin Manager. To install the jMaki Framework Support plugins, do the following:

  1. Choose Tools > Plugins to open the Plugin Manager.
  2. Make sure the Available Plugins tab is selected, then select the Install option for both the jMaki Ajax Support plugin and the jMaki for Web Applications plugin:
    jMaki Ajax Support plugin listed under Available Plugins
  3. Click install to open the NetBeans IDE Installer, then click Next and accept the license agreement. Restart the IDE to allow changes to take effect.

    Note: You may receive a validation warning if you are trying to install a plugin that has not been signed. While you can generally trust all plugins, when you install a plugin that has not been signed, you are doing so at your own risk.

Downloading Manually

  1. Download a framework support plugin directly from an external resource. For example, you can find a download link from the plugin development location, or you can follow a link to the Plugin Portal from the table above. Download the framework support plugin(s) to your computer. NetBeans plugins can be identified by their .nbm extension, e.g., the jMaki framework support plugins are the listed org-netbeans-modules-sun-jmaki.nbm and org-netbeans-modules-sun-jmaki-javaee.nbm files.
  2. From the IDE's main menu, choose Tools > Plugins to open the Plugin Manager. Select the Downloaded tab, then click the Add Plugins button.
  3. In the Add Plugins dialog, navigate to the location where the two plugins were saved on your computer, and click Open. A description of each plugin displays in the Plugin Manager. For example, if you selected jMaki, you see the following:
    jMaki framework support plugin displayed in the Plugin Manager prior to installation
  4. Click install to open the NetBeans IDE Installer, then click Next and accept the license agreement. If you receive a validation warning, click Continue to install the plugin. A validation warning occurs if you attempt to install a plugin that has not been signed. Restart the IDE to allow changes to take effect.

Working with Framework Support in the IDE

Framework support in the IDE is generally specific to the framework you are working with. For example, jMaki UI support allows you to drag and drop web components from the IDE's Palette directly into the page you are working on in the Source Editor, while Spring support includes code completion and navigation for Java classes and bean references in configuration files, as well as numerous wizards for commonly-used classes.

You can add framework support to a web application either through the New Project wizard at the time you create the application, or you can integrate support into an existing application retroactively. The following demonstrates both methods, using jMaki as an example:

Adding Framework Support to a New Project

  1. Choose File > New Project (Ctrl-Shift-N) from the main menu. The New Project wizard opens. Select Web under Categories, then under Projects, select Web Application. Click Next.
  2. Type jMakiTestApp for the Project Name and specify a location for the project on your computer.
  3. Step through the wizard and accept any default settings. Specify a server to deploy the application to by choosing one that is already registered with the IDE (i.e., the GlassFish server or Tomcat).
  4. In the final step of the New Project wizard, the Frameworks panel, choose jMaki Ajax Framework. The jMaki Ajax Framework option was added when you installed the framework support plugin. The support plugin also enables you to specify a CSS layout to use in your web application:
    jMaki Ajax Support listed in Frameworks panel of the New Project wizard
  5. Select the Standard CSS Style layout and click Finish.

The IDE creates the web application using the jMaki application structure, which includes jMaki-specific artifacts in the resources folder. Also note that framework libraries are added to the new project's classpath. Examine the logical structure of the web application in the Projects window:

Logical structure of jMaki web application displayed in Projects window

Note: For more information on the jMaki application structure, see Basic jMaki Application Structure.

Adding Framework Support to an Existing Project

  1. In the Projects window, right-click the web application project's node and choose Properties. The Project Properties window displays.
  2. Under Categories, select Frameworks. The right panel displays a Used Frameworks text area, which is empty if the application does not use a framework.
  3. Click the Add button, then select the framework you want to work with and click OK:
    Add framework support to an existing application in the Project Properties window
  4. Depending on the chosen framework, specify any further framework-specific configuration settings presented in the Project Properties window (i.e., jMaki support allows you to specify a CSS layout, whereas Spring Web MVC support enables you to specify initial configuration settings). Click OK to confirm your selection and close the Project Properties window. Framework-specific artifacts and libraries are added to your project, which you can examine in the Projects window.

See Also

This document described how to add support for a web framework in NetBeans IDE. It demonstrated how to install framework support plugins by downloading manually as well as via an update center in the IDE's Plugin Manager. It also showed how to add an IDE-supported framework to both a new web application project and an existing project.

This tutorial focused on using the jMaki Ajax framework. If you would like to explore the other features offered by this framework, see jMaki Developer Resources for further documentation. Also, the Sun Web Developer Pack provides tutorials and sample projects to help you learn more about developing with the jMaki framework, and other Ajax-oriented technologies.

For more information about using other web frameworks in NetBeans IDE, see the following resources: