Web Application Tasks: Quick Reference

This topic describes common tasks you can perform with web application projects. For more detailed information, click the links in the right column.

To perform this task Follow these steps
Create a project.
  1. Choose File > New Project (Ctrl-Shift-N).
  2. Select the right template for your project. 
Open a project
  • Choose File > Open Project.
Choose a framework. For standard projects, support for JavaServer Faces, Struts, Spring, and Visual Web JavaServer Faces is provided out-of-the-box. The libraries and configuration files used by these frameworks are packaged with the IDE. Code completion and other Source Editor functionality is also available for these frameworks. To add a framework to an existing application, do the following:
  1. Right-click a standard web application and choose Properties.
  2. In the Project Properties dialog box, click Frameworks.
  3. Select one of more of the following: JavaServer Faces, Visual Web JavaServer Faces, or Struts.
  4. Click OK to confirm your selection and exit the Project Properties dialog box.
Add a JAR file to a project's classpath.
  1. In the Projects window, expand the project node and right-click the Libraries node.
  2. Click Add JAR/Folder and select the JAR file in the file chooser.

    If you also want to attach source code and Javadoc for the JAR file, click Add Library instead.

Modify a library reference
  1. Choose Tools > Libraries.
  2. In the Library Manager dialog box, select the library in the Libraries list box.
  3. Add, remove, or change the order of the files.
Add themes to a project
  1. In the Projects window, right-click the Libraries node and choose Add Library.
  2. In the Add Library dialog box, click Manage Libraries.
  3. In the Library Manager dialog box, click New Library
  4. In the New Library dialog box, enter the theme name and choose Theme Libraries as the library type.
  5. In the Classpath tab of the Library Manager, add the theme JAR file.
Set current theme
  1. In the Projects window, open the Themes node.
  2. Right-click the theme as choose Set As Current Theme.
Add bean properties to a project's managed beans (Visual Web JSF)
  1. Ensure that a page is open in the Visual Editor and that the editor is in the default Design mode.
  2. In the Navigator window, double-click the node for the managed bean to which you want to add a property.

    For example, double-click SessionBean1.

  3. In the Java editor, add the new field.

    For example, after the SessionBean1 constructor public SessionBean1(), type

    private String myString;

  4. Right-click the new field and choose Refactor > Encapsulate Fields.
  5. In the dialog box, the new field should show the getter and setter that will be generated for the field, and the new methods should be set to Public and to Use Accessors Even When Field is Accessible. Click Refactor to generate the two methods.
Set up compilation dependencies between projects.
  1. expand the project node and right-click the Libraries node.
  2. Click Add Project and select the project folder for the project that you want to add to the project's classpath.
Open projects required by your web application.
  • In the Projects window, right-click the project node and choose Open Required Projects. A required project is a project that has been packaged with the application or that has been added to its classpath.
Find files, text strings, and objects in a project
  1. In the Projects window, right-click the project or any folder and choose Find.
  2. Enter the search criteria and click Find.
Generate Javadoc
  • Choose Build > Generate Javadoc for project name .
Build a project.
  1. Make sure that your resources are on the classpath.
  2. Choose Build > Build Main Project (F11) or right-click any project node and choose Build.
Compile a single file
  1. In the Projects window, navigate to the file and right-click it.
  2. From the main menu, choose Build > Compile File.
Clean a project.
  • Right-click the project node and choose Clean.
Run a project.
Modify deployment settings.

Do one or both of the following:

Debug a project.
  • Right-click the project and choose Debug Project or choose Run > Debug Main Project (Ctrl-F5). For free-form projects, you must create an Ant target for this purpose.
Attach source code to libraries for debugging.
  1. Choose Tools > Libraries from the main window.
  2. If the JAR file is not already registered in the Library Manager, create a new library using the Add Library button.
  3. Select the library in the left panel of the Library Manager.
  4. In the Classpath tab, click Add JAR/Folder and specify the location of the JAR file containing the compiled class files. A library can contain multiple JAR files.
  5. In the Sources tab, add the folder or archive file containing the source code.
Add Javadoc to a project.
  1. Choose Tools > Libraries from the main window.
  2. If the JAR file is not already registered in the Library Manager, register the JAR file as described above.
  3. In the Javadoc tab, click Add ZIP/Folder and specify the location of the Javadoc files.
Set the main project.
  • Right-click the project node and choose Set as Main Project.
Set Start Page
  • In the Projects window, right-click the page to use as the start page and choose Set as Start Page.
Save a project
  • Choose File > Save All.
Copy a project
  • In the Projects window, right-click project-name and choose Copy.

Legal Notices