Welcome Files and Redirection

 

+

Search Tips   |   Advanced Search

 

Out of the box there is no default application configured for WebSphere Application Server server instances. So, for example, if you have an application server running on http://www.myhost.com, you can pull up apps like http://www.myhost.com/snoop and http://www.myhost.com/helloHTML (which are part of DefaultApplication.war), but pulling up http://www.myhost.com by itself yields an error message.

To install an application as the default app, you can deploy a WAR file to the appserver, specifying the context root as "/". For example, here is the contents of a simple WAR file generated using RAD. This application, once deployed, will create a default home page that redirects users to a portal home page running on the same server.:

META-INF  WEB-INF  index.jsp  theme

./META-INF:
MANIFEST.MF

./WEB-INF:
ibm-web-bnd.xmi  ibm-web-ext.xmi  web.xml

./theme:
Master.css

The web.xml file specifies index.jsp as the Welcome File, which means that if no file name is specified, the page will default to index.jsp.

You can install this WAR file directly to a WAS server, such as server1 or WebSphere_Portal. Be sure to stop the DefaultApplication.war application before deploying your WAR file.

If you create the WAR file in RAD, and then deploy to WAS v51, you might get errors referencing invalid syntax in the web.xml file. If this happens make sure that you have the correct versions specified in the DOCTYPE web-app line. WAS 5.1 will not work with a web-app_2_4.dtd DTD file. See the example web.xml for the correct syntax.

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.