Deploying a Web Application
See Also
When you run a web application, the IDE automatically builds, deploys, and runs the
web application using the project's ant build script and target server.
To deploy a web application:
- (Optional) Define parameters to pass
to one or more JSP files, servlets, or both.
- (Optional) Specify a different welcome file by right-clicking the project node in the
Projects window, choosing Properties, clicking Run, and typing it in the Relative URL text box.
|
The welcome file specified in the Project Properties window overrides the
welcome file set in the web.xml file. If no welcome file is defined
in the Project Properties window, the first existing welcome file defined in
the web.xml file's
welcome-file-list
is displayed. If the server does not find a welcome file, the server's default
servlet displays the root of the web application. You can change the behavior
of the default servlet in the web.xml file.
|
- (Optional) Specify a different target server or
browser.
- In the Projects window, right-click the project's 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.
- Note: The Compile on Save feature is enabled by default for web projects. The IDE
recompiles and deploys the project application when you save changes to project files in
the editor. The Compile on Save feature can be toggled from the Run category in the Project
Properties window.
The IDE sends the web application's URL to the server. The URL is derived from the server's URL,
the web application's context path, and the relative URL or welcome file.
Troubleshooting
The Output window displays error information and the HTTP monitor displays requests, data states,
and the servlet environment.
- If you get HTTP 404 or Not Found error messages when you execute a web application, see
Accessing
Local files Through a Proxy for possible solutions. Also verify the following:
- The URL is correct.
- The servlet
mapping in the web.xml file is correct.
- The application's resources are in the appropriate location.
- See Also
- About Deploying Web Applications
- Running a JSP File
- Running a Servlet
- Redeploying an Application to a Different Server
Legal Notices