Netscape Enterprise Server/ iPlanet Web Server 4.0 and 4.1 supported the Java Servlet 2.1 specification. This specification did not include web applications. A deployment scheme was developed to make servlet deployment simpler. With the advent of Java web applications (.war files) and their deployment descriptors, it is no longer necessary to maintain a proprietary deployment system.
iPlanet Web Server 6.0 supported both types of deployment schemes, but the 4.x implementation (referred to as legacy servlets) was marked as deprecated (See Chapter 8: “Legacy Servlet and JSP Configuration” of the iPlanet Web Server, Enterprise Edition Programmer's Guide to Servlets).
Sun Java System Web Server 6.1 no longer supports legacy servlets. The legacy-style properties files for the server you want to migrate (servlet.properties, context.properties, and rules.properties) are removed during migration. For more information about these files, see "Appendix A" in the Sun Java System Web Server 6.1 SP10 Administrator’s Configuration File Reference.
Because there is no one-to-one mapping for all of the features, legacy servlets cannot be migrated automatically. This section describes the main features involved in migrating legacy servlets to web applications.
This appendix includes the following topics:
In Sun Java System Web Server 6.1, JSP by extension works as it did in previous releases. Any file in the document tree that is named as an extension of .jsp will be treated as a JSP as long as the Java is turned on for the virtual server.
This is not supported in Sun Java System Web Server 6.1. You can deploy a web application to respond to a directory, but all of the servlets must be in the WEB-INF/classes directory of the web application. You can no longer copy a servlet in the .class file into the document tree and have it run as a servlet or have all of the contents of a directory run as a servlet. The web application will treat only .class files as servlets.
In the legacy servlet system there was a two-step process of registering servlets (servlet.properties) and mapping them to a URL (rules.properties). In Sun Java System Web Server 6.1, the servlets must be moved into a web application, and these settings will be maintained in the web.xml file of that web application.
A registered servlet contains entries in both the servlet.properties and rules.properties files.
The following example uses a servlet file called BuyNow1A.class, which respons to /buynow. It is assumed that the web application is deployed at '/'.
The servlet.properties file has:
servlet.BuyNowServlet.classpath= D:/Netscape/server4/docs/servlet/buy;D:/Netscape/server4/docs/myclasses servlet.BuyNowServlet.code=BuyNow1A servlet.BuyNowServlet.initArgs=arg1=45,arg2=online,arg3="quick shopping"
The rules.properties file has:
/buynow=BuyNowServlet
Those must be translated to a web.xml setting.
The servlet.properties setting will translate into the <servlet> element.
The classpath is automated so there is no classpath setting. All classes to be used must be in the WEB-INF/classes directory or in a .jar file in the WEB-INF/lib directory of the web application.
The servlet-name element is the part between the dots in the servlets.properties file. The code translates to the servlet-class. IntArgs translate to init-params. This entry would translate to:
<servlet> <servlet-name> BuyNowServlet </servlet-name> <servlet-class> BuyNow1A </servlet-class> <init-param> <param-name> arg1 </param-name> <param-value> 45 </param-value> </init-param> <init-param> <param-name> arg2 </param-name> <param-value> online </param-value> </init-param> <init-param> <param-name> arg3 </param-name> <param-value> “quick shopping” </param-value> </init-param> </servlet
The rules.properties entries translate to servlet-mapping elements. This entry would translate to.
<servlet-mapping> <servlet-name> BuyNowServlet </servlet-name> <url-pattern> /buynow </url-pattern> </servlet-mapping>
Some other entries in the servlets.properties file map to the web.xml file. These include.
Servlets.startup: The servlet listed here should have a load-on-startup element in it.
Servlets.config.reloadInterval: This translates to the dynamicreloadinterval attribute of the JAVA element in server.xml. This is an instance-wide setting so it affects all virtual servers and all web applications.
Servlets.sessionmgr: This translates to the session-manager element in the sun-web.xml file.