This is not a complete list of changes (for that you should see the changelog) but it does go into a bit more depth on the (hopefully small) changes that you may need to make to your program when you upgrade to a new version of DWR.
Full documentation on upgrading from version 2.0 to version 3.0.
Version 2 has a number of changes, many of which are optional. The changes are documented under upgrading to version 2.0.
Version 1.1 is largely backwards compatible with 1.0
Of the changes for 1.1 the change most likely to cause compatibility problems is the updates to error handling. The changes were largely to fix bugs, so you might be affected if you were relying on buggy functionallity.
ExecutionContext has been deprecated in favor of WebContext and WebContextFactory. It's a straight swap.
We found some issues with putting callback functions at the start of the parameter list, so the recommended proceedure is to put them at the end.
A number of Creators which have been deprecated for a while were removed in version 0.9. Generally speaking the 'new' creator will do the job of the old ones, using a scope attribute to specify object lifetime.
We've also done a significant amount of work to get util.js smaller and neater. A number of function that were not DWR's core business have been deprecated, and include a warning message.
It has been true for a while, but it is worth noting the only attributes that are 100% correct for a <create ...
element are creator="..."
and javascript="..."
. Other common attributes like class="..."
should be put as a nested param elements. E.g. <param name="class" value="..."/>
There are even more new features with this release. The biggest backwards incompatible change is to logging where the output is now more fine grained then before, so you might need to change your logging configuration to avoid being swamped.
Also the Converter interface changed slightly to help pass on extra type info for Collections.
There are plenty of new features with DWR 0.6, however all changes are backwards compatible so no edits are required to your applications.
All the functions in util.js and engine.js are now 'static class' functions. The old versions are deprecated, and you will get a warning to move over as an alert box. The new versions should have less chance of name clashes.
The Spring Creator has been given an overhall. The resourceName parameter is deprecated, and will be removed soon. It is probably best to look at the configration documentation to see how the new version works.
web/WEB-INF/web.xml has a fully fleshed out example of the options for dwr. 2 parameters (config and logLevel) you can safely ignore. The 3rd, debug, you should leave as true if you want the test/debug setup to work (this is what you are using below) I would suggest turning this off in live.
Secondly you will need a dwr.xml file that does the job of the old allow parameter. By default it lives in WEB-INF/dwr.xml (there is an example in the web folder of this too)
I suggest starting with the example in the web/WEB-INF folder and removing the <init> section and for each allow have a <create creator="new" javascript="Test" class="full.java.pkg.Test"/> tag.
The different type of creators allow us to have different sources for the beans. new
was all that existed in dwr 0.3. session
gets the bean from the session (creating it if it does not exist). spring
uses the spring framework and static
works on static methods only.
You can remove all the converter options in the allow section. By default all primitive types, arrays and Strings get converted without need for declaration. The system dwr file in java/uk/ltd/getahead/dwr
might help you see what is going on a bit.
There is one other breaking change, where in your html you were doing:
<script type='text/javascript' src='/XXX/dwr/interface/full.java.pkg.Test.js'> </script>
You would need to do:
<script type='text/javascript' src='/XXX/dwr/interface/Test.js'> </script>
Where Test is the value you specify in the javascript attribute in your create tag (see above).