Using Netscape iPlanet with Resin


Using IIS with Resin

On the Windows platform, IIS and Personal Web Server (PWS) are two ways of dealing with requests for client browsers. Each of the servers handle traditional HTML pages as well as one written with Active Server Pages (ASP). Figure 16.5 shows an example of how you can use IIS as the primary Web server front end to Resin acting as a servlet engine (just as we did for Apache). Instead of using a shared object, you use a dynamic link library (DLL) to transfer requests from IIS to Resin.

click to expand
Figure 16.5: Using IIS and Resin.

For this discussion, we assume that you've already installed either IIS or PWS. (In most all cases, the operating system installation process also installs the server.) There are two ways to configure Resin for IIS support: automatically and manually. Let's start with the automatic approach:

  • Step 1—Browse to the /bin directory of your Resin installation. Doubleclick on the icon called setup.exe to open the dialog box shown in Figure 16.6.

    click to expand
    Figure 16.6: The Resin setup dialog box.

  • Step 2—In the edit line for IIS or PWS, select the correct location of wwwroot and click OK. Setup asks if you want to restart IIS to accept the new plug-in. Click OK.

  • Step 3—At this point, place in the Resin configuration file all of the configuration information for directories under IIS. This includes all virtual directories. Here's an example:

     <resin>   <server>     <servlet-mapping url-pattern='/servlet/*'       servlet-name='invoker'/>     <servlet-mapping url-pattern='*.xtp'       servlet-name='com.caucho.jsp.XtpServlet'/>     <servlet-mapping url-pattern='*.jsp'       servlet-name='com.caucho.jsp.JspServlet'/>   </server> </resin> 

This configuration lets the Resin server know that the appropriate JSP servlets can be found in the c:\inetpub\wwwroot directory as well as in \servlet. For virtual directories, use the <path-mapping> element to map requests to the right file location.

Testing IIS and Resin

Now start Resin by double-clicking the httpd.exe icon in the Resin installation directory or by starting the Resin server service. Create a new file called test.jsp in the Apache document directory specified in the resin.conf configuration file and add the following JSP code to the file:

 <HTML> <BODY> <%  java.util.Date date = new java.util.Date(); %> It worked! Today is <%= date %> </BODY> </HTML> 

Browse to the file with http://localhost/test.jsp and you should see the output shown in Figure 16.3. If you don't see the expected output or you receive an error, check over the steps.




Mastering Resin
Mastering Resin
ISBN: 0471431036
EAN: 2147483647
Year: 2002
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net