The New Web Application wizard creates a new
containing an empty web application. You open the New Web Application
wizard by opening the New Project wizard and selecting
the Web Application template from the Java Web category.
In the Server and Settings page, you have to set the following properties:
Add to Enterprise Application. Lets you add the web project
to any open enterprise application project. If you do not add it here, you
can do so later by expanding the enterprise application project node and
right-clicking the Java EE Modules node.
Server. Specifies the web application's server. Only servers
that are
registered
with the IDE are available to be selected here.
The default installation of the IDE's Java bundle includes the Glassfish
application server, and the Tomcat web server. Servers included in the
installation are automatically registered in the IDE.
Copy Server JAR Files to Libraries Folder. If you are using a
dedicated folder for storing libraries, you can select this option to copy the
server JAR files required for compilation into the dedicated libraries folder.
If not selected, other users will need local copies of the server JAR files to
build the project.
Java EE Version. Specifies the Java EE level against which your
web application will run. Note that Java EE 6 applications require a Java EE 6 server,
such as GlassFish version 3.
Enable Contexts and Dependency Injection. Contexts and Dependency
Injection (CDI) is specified by JSR-299. When selected, this option generates a
beans.xml file in the project's WEB-INF folder when the
project template is created. The beans.xml file is used by CDI to
instruct the Java EE-compliant server that the project is a module containing CDI
beans.
Context Path. Specifies a way to distinguish resources in one web
application from resources in others that are deployed on the same server instance.
The context of an application determines the URL namespace of the contents of the web
application. When a web application's context property value is set, you access the
web application at: http://hostname:port/context/some_file.some_extension.
For example, with the property value set to /HelloWeb, you could access
the application's entry point index.jsp file at:
http://hostname:port/HelloWeb/index.jsp.
If you click Next, you can let the IDE provide your application with the libraries needed
to work with various frameworks, including JavaServer Faces, Struts, Spring, and Hibernate.
If you click Finish, the project is created on your computer and opened in the IDE.
You can view its logical structure in the Projects window and its file structure in the
Files window.
If you are creating a web project from existing sources, you must click Next to
specify the location of your web pages, Java sources and libraries.