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. |
- Choose File > New Project (Ctrl-Shift-N).
- Select the right template for your
project.
|
| Open a project. |
- Choose File > Open Project in the main menu.
|
| Choose a framework. |
For standard projects, support for
JavaServer Faces,
Struts,
Hibernate, and
Spring 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:
- Right-click a standard web application and choose Properties.
- In the Project Properties dialog box, click Frameworks.
- Select one of more of the following: JavaServer Faces, Spring, Hibernate, or Struts.
- Click OK to confirm your selection and exit the Project Properties dialog box.
|
| Add a JAR file to a project's classpath. |
- In the Projects window, expand the project node and
right-click the Libraries node.
- 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. |
- Choose Tools > Ant Libraries in the main menu.
- In the Ant Library Manager, select the library in the Libraries list.
- Add, remove, or change the order of the files.
|
| Add themes to a project. |
- In the Projects window, right-click the Libraries node and choose Add Library.
- In the Add Library dialog box, click Manage Libraries.
- In the Ant Library Manager, click New Library.
- In the New Library dialog box, enter the theme name and choose Theme Libraries as the library type.
- In the Classpath tab of the Ant Library Manager, add the theme JAR file.
|
| Set current theme. |
- In the Projects window, open the Themes node.
- Right-click the theme as choose Set As Current Theme.
|
| Set up compilation dependencies between projects. |
- Expand the project node and right-click the Libraries
node.
- 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. |
- In the Projects window, right-click the project or any folder and choose Find.
- Enter the search criteria and click Find.
|
| Generate Javadoc. |
- Choose Build > Generate Javadoc for project name.
|
| Build a project. |
- Make sure that your resources are on the classpath.
- Select the node of the project that you want to build in the Projects window.
- Choose Run > Build
Project (F11).
Alternatively, right-click the project node and choose Clean and Build.
- Note: The Compile on Save feature builds your project each time that you save a file in the project.
You can disable this feature in the Compiling page of the Project Properties dialog box.
|
| Compile a single file. |
- In the Projects window, right-click the file that you want to compile
and choose Compile File (F9).
Alternatively, you can select a file in the Projects window and
choose Build > Compile File from the main menu.
|
| Clean a project. |
- Right-click the project node and choose Clean.
|
| Modify deployment settings. |
Do one or both of the following:
|
| Deploy a project. |
- Right-click the project and choose Deploy.
The project is compiled. If the
application has already been deployed to the server, it is undeployed (all
the content is deleted). The application WAR file is then deployed to the
appropriate deployment directory.
|
| Run a project. |
- Select the node of the project that you want to run in the Projects window.
- Choose Run > Run
Project (F6) in the main menu or right-click any project node and choose Run.
The project is compiled, and new and changed files are copied from the
project's build directory to the WAR's deployment directory. The
deployed application then opens in a browser.
|
| Debug a project. |
- In the Projects window, right-click the node of the project that you want to debug and choose
Debug.
Alternatively, set the project as the main project and choose Debug > 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. |
- Choose Tools > Ant Libraries in the main menu.
- If the JAR file is not already registered in the Ant Library Manager,
create a new library using the Add Library button.
- Select the library in the left panel of the Ant Library Manager.
- 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.
- In the Sources tab, add the
folder or archive file containing the source code.
|
| Add Javadoc to a project. |
- Choose Tools > Ant Libraries in the main menu.
- If the JAR file is not already registered in the Ant Library Manager,
register the JAR file as described above.
- In the Javadoc tab, click
Add ZIP/Folder and specify the location of the Javadoc files.
|
| Set the main project. |
- In the main menu, choose Run > Set Main Project and choose the project
name in the sub-menu.
|
| Save a project. |
- Choose File > Save All. When you save a project, the IDE builds the project for you
if Compile on Save is enabled.
|
| Copy a project. |
- In the Projects window, right-click project-name and choose Copy.
|