Active Server Pages (ASP) is a Web application framework that was introduced by Microsoft as part of its Internet and server business strategy. ASP is included with Windows NT 4.0 Server as an extension to Microsofts Internet Information Services (IIS), Microsofts Web server solution.
Over the last three years, ASP has become remarkably popular and the trend is continuing. ASPs popularity is primarily due to its simplicity, ease of use, and the common availability of ASP development tools. The following are some benefits of ASP:
The ability to combine scripting (VBScript and JScript) with HTML
Built-in objects for Web server information exchange
Installable components that provide prebuilt functionality for writing sophisticated e-Commerce/Web applications
Simple, straightforward access to databases In addition, ASPs intrinsic support for Microsofts Component Object Model (COM) and the new COM+ architecture that Microsoft is developing for Windows 2000 has resulted in a large ASP add-on component market similar to what was witnessed with Visual Basic at one point. These factors, along with the popularity of ASP development tools such as Macromedias Drumbeat 2000 (www.drumbeat.com/) and Microsofts Visual InterDev (msdn.microsoft.com/vinterdev/), have greatly contributed to ASPs tremendous success.
But, despite most developers love for ASP, those same developers are painfully aware of ASPs greatest limitation: it runs on only one operating system platform and Web serverWindows NT 4.0 with IIS. The majority of Internet and intranet servers are hosted on non-Windows NT platforms, largely due to concerns over Windows NTs scalability and reliability. Given these facts, the problem becomes obvious. On one hand, developers are lured by the ASP development environment, its toolsets, and the benefits ASP provides a Web site. On the other hand, Webmasters and server administrators are cringing at the thought of deploying mission-critical e-commerce applications on anything other than their perfectly suited, high-end servers. The simplest solution is to make ASP deployment possible on all platforms, including the AS/400.
To solve this need for a cross-platform ASP, I will discuss Halcyon Softwares Instant ASP (iASP) product and how it can be used to deploy ASP applications on an HTTP Server for AS/400 Web server using IBMs WebSphere Application Server. I will
look at what iASP is, how to install and configure it on your AS/400, and how to get started running ASP applications on your HTTP server.
Instant ASPASP for AS/400
Instant ASP is a cross-platform ASP deployment solution. iASP is built as a Java servlet and, as a result, can run ASP applications with any Web server on any Java-enabled platform, including the AS/400. iASP replicates and extends the ASP environment by providing support for scripting, built-in objects, installable components, several third-party components, intrinsic support for external Java binaries, connectivity to remote COM/DLL binaries from AS/400, CORBA (Visigenic) and Enterprise JavaBeans support, and more. All the objects, components, and add-ons are built as JavaBeans to ensure portability.
So, how does iASP work? On the AS/400 platform, iASP gets attached to WebSphere as a servlet. The WebSphere product is connected to the IBM HTTP Server. When a request from a client (Web browser) comes in for an ASP application (or pagetypically indicated by the .asp extension), the HTTP Server sends a request to WebSphere, which passes the request to the iASP engine. iASP processes the application page, executes the embedded scripts, computes the results, and returns the HTML data to the HTTP server. The HTTP server then transmits the HTML back to the client.
iASPs AS/400 System Requirements
In the next few sections, I will review iASP installation on the AS/400 platform. Before doing so, Ill take a quick look at the system requirements for running iASP on your AS/400 system.
It is highly recommended that you install WebSphere 1.1 and Java Development Kit (JDK) 1.1.7 on your AS/400. Older versions of these products may work, but they have not been tested with iASP. To get iASP running for the first time under OS/400, I installed the product on OS/400 V4R3 and followed the process detailed in this article. However, the instructions listed here should work the same way on OS/400 V4R4 or any IBM WebSphere-based environment. Newer OS/400 V4R4 systems ship with this recommended configuration. For V4R3 systems, you can order WebSphere from IBM, but be sure to install the prerequisite PTFs on your AS/400 first. Systems older than V4R3 have not been tested. Simply put, in order to run iASP, you must have a Web server that supports Java servlets. In addition to the OS/400 software, you will need a copy of iASP Developer edition (limited to two concurrent connections), available free of charge from Halcyon Software at www.halcyonsoft.com.
Configuring iASP on AS/400
Start by mapping the AS/400 system from your installation Windows system so that it is accessible (with write permissions) from the Windows Explorer. This can be done by using the Client Access for Windows 95/NT network drive function or by using AS/400 NetServer to map a drive to the root (/) directory of your AS/400 Integrated File System (AS/400 IFS).
Next, install iASP on your Windows system in an appropriate folder. (Ill use c:iasp for this example.) Once iASP is installed on the local system, using Windows Explorer, copy the entire c:iasp folder over to the proper folder on the networked drive you created in the last paragraph. (I created another folder called /iasp in the root (/) directory of the AS/400 IFS.)
The next step is to add iASP to your WebSphere servlet setup. Start the WebSphere Manager applet by pointing your Web browser to its URL on the AS/400 system (typically http://
1. Click on the Setup button and add the following lines to the Java Classpath textbox (Figure 1). Doing so adds all the files you have installed your AS/400 IFS /iasp/lib/ folder. The following are the files to be added:
/iasp/lib/iasplib.jar:/iasp/lib/iasp_chart.jar:
/iasp/lib/iasp_image.jar:/iasp/lib/iasp_exec.jar:
/iasp/lib/iasp_sock.jar:/iasp/lib/iasp_mail.jar:
/iasp/lib/iasp_pop3.jar:/iasp/lib/rjax.jar:/iasp/
lib/classes
2. Click on the Servlets button and add iASP to the list of WebSphere servlets, as shown in Figure 2. Use the following parameters:
Servlet Name = iasp
Servlet Class = jhost.jaspservlet.jaspServlet
Once you add iASP as a servlet and click on the Test Servlet button, WebSphere will load the servlet and run some tests on it. The final results should indicate that the servlet has passed all the tests. The iASP servlet is now registered in the WebSphere servlet list. Note that you should not turn on the Bean Servlet option since iASP is not a Bean- based servlet.
3. Click on the Servlet Aliases option (Figure 3, page 24) and add an alias for the .asp extension mapped to the newly added iASP servlet. Doing so will program WebSphere to route all requests for .asp files to the iASP servlet. The text to add the extension is the following:
*.asp iasp
Configuring the HTTP Server
Now that WebSphere is ready to route .asp requests to iASP, its time to configure the HTTP server so that it will forward .asp requests to WebSphere. Use the following steps to configure the HTTP server:
1. Start the ADMIN server if not already started. This can be done by typing the Start TCP/IP Server (STRTCPSVR) command as follows:
STRTCPSVR SERVER(*http) HTTPSVR(*admin).
2. Go to the HTTP Server Administration pages by pointing your browser to the following URL: http://
3. Click on the Configuration and Administration button and follow the Configurations/Request Processing/Request Routing dropdown path.
4. Enable HTTP support for ASP files (*.asp) by entering the following values on the Request Routing screen to add this entry:
Click on the desired Index number in the table that you want to add this entry before or after by clicking on the Index dropdown and selecting the target routing index number.
Select either the Insert Before or Insert After radio button to indicate whether you want to insert this entry before or after the index number you just selected.
In the Action dropdown box, select Service from the dropdown menu.
In the URL Template field, enter the following:
/*.asp
In the Replacement File Path Field, enter
/QSYS.LIB/QHTTPSVR.LIB/QZHJSVLT.SVRPGM: AdapterService
Leave all other fields as they are.
Click on the Apply button to add this entry.
5. In order to access the samples under the /iasp folder, you will need to provide access to it through your HTTP server. This will also be done from the HTTP Server Administration page. Just add the /iasp folder in your accessible table
6. Shut down all instances of your WebSphere and IBM HTTP server by running the End TCP/IP Server (ENDTCPSVR) command as follows:
ENDTCPSVR SERVER(*HTTP) HTTPSVR(*ALL)
Depending upon how you have configured your HTTP server, this may or may not terminate the WebSphere. By default, this should bring down your WebSphere as well. Please refer to the WebSphere documentation for more information.
7. To restart the HTTP Server, enter the Start TCP Server (STRTCPSVR) command with the name of the particular server instances you want to start. To start all defined server instances, type in the command as follows:
STRTCPSVR SERVER(*HTTP) HTTPSVR(*ALL)
This is the last and perhaps the simplest step. However, it is this one step that somehow causes most problems. Simply put: if the servlet passed all the tests and you cannot run the samples, the problem is most likely with the .ASP routing, which means that either you made some typos or did not shut down the server properly. In my case, I spent a long time until I finally realized that the HTTP Server had other instances hanging around and therefore, was not being initialized with the modified properties.
Now that you have configured the system, Ill move on to ASP execution.
Running ASP on AS/400
The moment of truth: Heres when you will try to run some very simple ASP samples to verify whether iASP is functional. Point your browser to the http://
The samples are provided to give you a very basic idea of the capabilities you have. In the interest of brevity, I will only mention those samples that demonstrate the extended capabilities provided by iASP.
One of these samples is named Tropics and it demonstrates the use of external Java classes as intrinsic ASP objects. A reference to an external Java object is created by this call:
set obj = server.CreateObject(attrib)
In this call, attrib.class is a Java class in the WebSphere Java Classpath. The ASP application can access its properties and methods using the same scripting syntax that it does with the built-in objects.
The Process sample is another interesting sample that shows how you can utilize your ActiveX or DLL binaries from your ASP application on the AS/400 system. You will need to install the R-JAX product on your Windows system to test this functionality. (RJAX makes Microsoft ActiveX, DLL, and COM components accessible to any Java
application running remotely or locally on any Java-enabled platform. More information on R-JAX is available at www.halcyonsoft.com/prods/r_jax/r_jax.htm.)
Finally, the ADO (Active Data Object) samples provide a complete introduction to building data-driven Web applications with ASP. Halcyons ADO implementation is compatible with Microsofts ADO. All the back-end plumbing is done using JDBC and can, therefore, support any database for which JDBC or ODBC drivers are defined. Clicking on the names of these samples will provide more information on the database schema and how to populate it in your environment. Once the database is prepared and populated, you will need to add the JDBC drivers classes in the WebSphere Java Classpath, modify the database connection string appropriately in the ASP application, and restart the server. iASP also provides complete remote management and configuration capabilities from license management to object pooling and all the way up to log file management. All these properties are remotely configurable from iASPs Remote Console Applet (Figure 4) using any Java-enabled Web browser.
Whats Next?
Lots! IBM has done a terrific job with Java support on the AS/400 platform, especially from a performance and portability standpoint. The first iASP execution, without ANY modification to our binaries, is ample proof of that. However, there is plenty more that is being done to improve and enhance iASP on the AS/400 platform. For instance, Halcyon is working on using the AS/400 Java Translator to convert iASP into a native AS/400 application, which will result in a performance boost to what is already a fast system. (The translation does not require the source code. I encourage you to try it out on your own. Read the AS/400 JDK documentation for more infromation on the translator and its usage.) Other enhancements in the areas of application server support, transaction server support, faster database connectivity, and more are also underway.
Related Materials
Halcyon Software Web site: www.halcyonsoft.com IBMs HTTP Server for AS/400 Web page: www.as400.ibm.com/http IBMs WebSphere Application Server for AS/400 Web page: www.as400.ibm.com/websphere AS/400 NetServer Web page: www.as400.ibm.com/netserver Better AS/400 Web Sites Through Microsoft Technology? Joe Hertvik, AS/400 Technology Showcase, September 1999 WebSphere for AS/400 Setup, Lisa Wellman, AS/400 NetJava Expert (Web Edition), February/March 1999, www.midrangecomputing.com/anje WebSphere-related Resources, Lisa Wellman, AS/400 NetJava Expert (Web Edition), February/March 1999, www.midrangecomputing.com/anje WebSphere Application Server for AS/400, Lisa Wellman, AS/400 NetJava Expert, February/March 1999 AS/400 Servlets 101, Sonjaya Tandon AS/400 NetJava Expert (Web Edition), February/March 1999, www.midrangecomputing.com/anje
Figure 1: WebSphere Application server management is also handled through a Web screen. This is the screen where you add Java classpaths.
Figure 2: iASP is added to your HTTP Server configuration as a servlet under the WebSphere application server.
Figure 3: Creating a server alias for your iASP servlet tells WebSphere to route all .asp file requests to the iASP servlet.
Figure 4: iASP properties are also configured from the Remote Console Applet.
LATEST COMMENTS
MC Press Online