Now that you have run the iSeries scenario application in the the workbench test environment, you can deploy the application to WebSphere Application Server, as if you were running the application in the real world. Before you deploy the application, however, you need to make a few adjustments, such as securing the administrator's page, and changing a Web service's URL so that the application points to the right place, as explained in the next sections.
Earlier in the chapter, we discussed Running the application in the workbench. Now that you have deployed the files to the iSeries server, you can run the application on your iSeries using WebSphere Application Server.
To deploy the application to WebSphere Application Server (optional) you need to ensure that:
Your Web-enabled iSeries applications use WebSphere Application Server to run the Java(TM) servlets and JavaServer PagesTM (JSPs) that communicate between the Web user's browser and the iSeries programs or data. To serve your HTML pages and JSP files from the same iSeries system, you also need an HTTP server on that system. We recommend that you use the IBM HTTP Server powered by Apache. You can find documentation about how to use this server in the: IBM HTTP Server for iSeries Documentation Center at http://publib.boulder.ibm.com/pubs/html/iseries_http/v5r1/index.htm.
WebSphere Application Server executes the JavaServer pages, Java beans(TM), and Java servlets that are generated for various processes. The primary documentation resources for IBM WebSphere Application Server for iSeries and IBM WebSphere Administrative Console for iSeries are available at the following Web sites:
Becoming familiar with the IBM WebSphere(R) Application Server documentation, in particular, the sections on J2EE modules, Installing WebSphere Application Server, and Setting up multiple instances of the WebSphere administrative server, is highly recommended. Minimally, you need to carry out the steps under the Installation link.
Use the site map to find information about how to install, configure, and obtain the required PTFs for WebSphere Administrative Console.
Because the administrator's page, index.html, should only be accessible by authorized people it should be properly secured. This can be done programmatically, in the Web application logic, or by using WebSphere's security feature. In this scenario, we used WebSphere security to secure the page. Note that we used WebSphere Application Server V4.0 Advanced Edition. You can find information about WebSphere Application Server at their Web sites:
If you are using a different version of WebSphere Application Server, refer to that version's documentation on securing Web resources.
You can configure security for Web resources, such as Web pages and servlets, within Development Studio Client, or in the Application Assembly Tool. For this scenario we use Development Studio Client.
To review the security configuration and properties for this Web application:
In the Security roles section, notice the defined security role named "Administrator." During deployment, individuals are assigned to this role and therefore given access to the index.html page. In the Authorized roles section, note that we have given the role Administrator access to this security constraint. With this security in place, only users assigned to the Administrator role are granted access to the index.html page, after they have provided the proper credentials such as user ID and password. When a resource is secured, WebSphere Application Server first attempts to authenticate the user. Authentication is done using certificates, or by prompting the user for a user ID and password. The prompting can be done with the basic authentication dialog, or by using a custom form.
In this scenario, we designed our own logon page named login.jsp. To configure its authentication prompt, select the Pages tab in the web.xml view. In the Login section, note that Form is pre-selected as the Authentication method. Also note that the name of the Login page is login.jsp. The Error page is displayed when the logon is unsuccessful. In this case, the application re-displays the login.jsp page.
You need to create EAR files to deploy your application to the iSeries WebSphere Application Server. An EAR file is a standard Java Archive (JAR) file with an .ear extension. They can contain multiple Web project, and you use them to package and deploy your Web applications to the WebSphere Administrative Server (WAS).
To create the EAR files:
Now that you have created the EAR files, you can deploy them to WebSphere Application Server.
To take on the role of the customer and run the retail store entry point, enter the following URL into a Web browser:
http://your iSeriesHostName:yourHTTPPortNumber/SV001585/shop.html
To take on the role of the administrator and run the WholeSale entry point, enter the following URL into a Web browser:
http://your iSeriesHostName:yourHTTPPortNumber/SV000618/index.html
If you do not know the HTTP port number, ask your WebSphere Application Server administrator.
Copyright IBM Corporation 1992, 2003. All Rights Reserved.