PATH  WebObjects 4.0 Documentation > What's New in WebObjects 4.0

Table of Contents Previous Section

Converting Java Code

This section covers the details of converting any Java code you may have in an existing WebObjects application (see step 2 of "Converting an Existing WebObjects Application," above). In WebObjects 4.0, the Java APIs changed considerably. These changes are summarized here:

Warning: Changing to Foundation-style methods for the dictionary class introduces a subtle change. The Java Hashtable classes take the arguments in the key-value order. For example, the put method takes the key and then the value. NSDictionary takes the value and then the key. The conversion scripts change the order of the arguments for you. Unfortunately, these scripts incorrectly convert uses of get() and put() on java.util.Hashtable objects as well as on objects of other Foundation classes.

Scripts are provided with the release to help you convert Java code to the new APIs. They are located in /System/Developer/Java/Conversion/WebObjects or, on NT, in $(NEXT_ROOT)/Developer/Java/Conversion/WebObjects. Descriptions of these scripts and instructions for their use can be found in the ReadMe file, which is located in the same directory as the script files.

Table of Contents Next Section