Web applications created in Java are generally ported as Web Application Archive (WAR) files. Once a project has been compressed as a WAR file, it is ready to be deployed on an application server. Most application servers automatically identify WAR files on restart and unpackage its contents into a new directory with the same name as the WAR. At that point, provided that the server is configured properly, the Web application contained in the WAR can be accessed over the Internet. NetBeans automatically creates a WAR file for Java Web applications every time you build your project.
- Skill level:
Other People Are Reading
Select "File" followed by "New Project" from the menu bar. The "New Project" window appears.
Select "Java Web" under the "Categories" options and "Web Application" under the "Projects" options. Click "Next."
Name your new project in the "Name and Location" screen. Leave all of the other options set to their default values. Select "Next."
Associate your project to the server you will be deploying the WAR file to. It is important that you make the correct selection, as NetBeans will automatically optimise your project for the selected server.
Select "Finish." Your new Web application will appear in the "Projects" pane on the left-hand side of the screen.
Create a New Web Project
Select "Run" from the NetBeans menu bar.
Check under the "Set Main Project" option to see if the project you intend to create a WAR file from is selected. If not, select the project by clicking on it.
Select the "Clean and Build Main Project" option under "Run."
Select the "Files" tab at the top of the left-hand frame of the NetBeans screen.
Select the "+" next to your application directory to expand its contents. You will see a new folder titled "dist."
Select the "+" next to the "dist" folder. Within the folder, you will see your newly created WAR file.
Creating the WAR File
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for