Task overview: Deploy web applications
Use this document to learn how to develop and deploy Web applications
A developer creates the files comprising a web application, and then assembles the web application components into a web module. Next, the deployer (typically the developer in a unit-testing environment or the administrator in a production environment) installs the Web application on the server.
- Optional: Migrate existing web applications to run in the new version of WAS.
- Design the web application and develop its code artifacts: Servlets, JSP (JSP) files, and static files, as for example, images and Hyper Text Markup Language (HTML) files. See the Web applications: Resources for learning topic for links to design documentation.
JSP programming tips:
- Disable session state of JSP files using <%@ page language="java" contentType="text/html" session="false" %> instead of <%@ page language="java" contentType="text/html" %>
- Replace setProperties calls in the JSP files with direct calls to the appropriate setxxx methods.
- Develop the Web application, using WebSphere Application Server extensions to enhance its functionality.
- Assemble the web application into a web module using an assembly tool. Web module assembly properties might include the ability to:
- Configure servlet page lists.
- Configure servlet filters.
- Serve servlets by class name.
Serving servlets by name or class name is triggered by setting the serveServletsbyclassnameEnabled property within IBM extensions. Use the invoker.patterns attribute to specify the patterns that trigger invocation of the server component and allows the serving of servlets by name or by class name. This value is a list separated by either a space, colon, or semicolon.
- Enable file serving.
In file serving, web applications can serve static file types, such as HTML. File-serving attributes are used by the servlet that implements file-serving behavior.
- Deploy the web module or application module containing the web application.
Following deployment, you might find it handy to use the tool that enables batch compiling of the JSP files for quicker initial response times.
- Optional: Troubleshoot the web application.
- Optional: Modify the default web container configuration in the application server in which you deployed the web module or application module containing the web application.
- Optional: Manage the deployed web application.
Subtopics
- Web applications
A web application is comprised of one or more related servlets, JSP technology (JSP files), and HTML files managed as a unit.
- Web modules
A web module represents a web application. A web module is created by assembling servlets, JSP (JSP) files, and static content such as Hypertext Markup Language (HTML) pages into a single deployable unit. Web modules are stored in WAR files, which are standard Java archive files.
- web.xml file
The web.xml file provides configuration and deployment information for the web components that comprise a web application.
- Default Application
WebSphere Application Server provides a default configuration that administrators can use to easily verify that the Application Server is running. When the product is installed, it includes an application server called server1 and an enterprise application called Default Application.
- Servlets
Servlets are Java programs that use the Java Servlet API. We must package servlets in a WAR file or web module for deployment to the application server. Servlets run on a Java-enabled web server and extend the capabilities of a web server, similar to the way applets run on a browser and extend the capabilities of a browser.
- Develop servlets with WebSphere Application Server extensions
Use this task to provide a summary of the WAS extensions that we can use to develop servlets.
- Configure JSP engine parameters
Learn about how to add, change or delete JSP engine configuration parameters.
- JSP
JSP (JSP) are application components coded to the JSP Specification. JSP enable the separation of the Hypertext Markup Language (HTML) code from the business logic in web pages so that HTML programmers and Java programmers can more easily collaborate in creating and maintaining pages.
- Develop web applications
Learn about selecting tools for developing web applications.
- Modify the default web container configuration
A web container handles requests for servlets, JSP (JSP) files, and other types of files that include server-side code. The web container creates servlet instances, loads and unloads servlets, creates and manages request and response objects, and performs other servlet management tasks. The web server plug-ins, provided by the product, help supported web servers to pass servlet requests to web containers.
- Assemble web applications
Assemble a web module to contain servlets, JSP (JSP) files, and related code artifacts. (Group enterprise beans, client code, and resource adapter code in separate modules). After assembling a web module, we can install it as a stand-alone application or combine it with other modules into an enterprise application.
- Task overview: Assembling applications using remote request dispatcher
Remote request dispatcher (RRD) is a pluggable extension to the web container which allows application frameworks, servlets and JSP (JSP) to include content from outside the currently executing resource's Java Virtual Machine (JVM) as part of the response sent to the client.
- Secure applications during assembly and deployment
Several assembly tools exist that are GUIs for assembling enterprise or Java EE applications. We can use these tools to assemble an application and secure EJB and web modules in that application.
- (iseries) Backup and recover servlets
Servlet source and class files, user profile data, Hypertext Transfer Protocol (HTTP) configuration, and administrative configuration should be considered for backup when using servlets. You should consider saving the HTTP configuration because changes to the HTTP configuration are often made to enable WebSphere Application Server to serve servlets and JSP requests, and to enable WAS security. You should consider backing up the user profile data if you use the User Profile function of WAS.
- (iseries) Backup and recover JSP files
JSP source and generated servlet classes, Hypertext Transfer Protocol (HTTP) configuration, and administrative configuration should be considered for backup when using JSP files.
- (iseries) User profiles and authorities
WAS uses two OS/400 user profiles by default, QEJB and QEJBSVR.
- Define an extension for the registry filter
The registry filter specifies if an extensions is applicable to all registry instances or to specified instances.
- Migrate web application components from WebSphere Application Server Version 5.x
Migration of web applications deployed in previous versions of WAS is usually not necessary. Versions 2.2 and later of the Java Servlet specification and versions 1.2 and 1.4 of the JSP (JSP) specifications are still supported unless the behavior was changed in the Servlet 3.0 or JSP 2.1 specifications. These changes are generally available in more detail in their corresponding specification.
- Tune URL invocation cache
The URL invocation cache holds information for mapping request URLs to servlet resources. This cache is Web container-based, and shared for all Web container threads. A cache of the requested size is created for each Web container thread that is available to process a request. The default size of the invocation cache is 500. If more than 500 unique URLs are actively being used (each JavaServer Page is a unique URL), you should increase the size of the invocation cache.
- Web application deployment troubleshooting tips
Deployment of a web application is successful if we can access the application by typing a Uniform Resource Locator (URL) in a browser or if we can access the application by following a link. If we cannot access the application, follow these steps to eliminate some common errors that can occur during migration or deployment.
- Web applications: Resources for learning
- Develop servlet applications using asynchronous request dispatcher
Web modules can dispatch requests concurrently on separate threads. Requests can be dispatched by the server or client.
Related concepts
Enterprise (Java EE) applications
JSP troubleshooting tips