These elements are mutually
exclusive, so if you want your default access policy for a given class to be to allow all methods
to be called, then you would specify a list of methods with the
element. Conversely,
if you want your default policy to disallow access to all methods, then set method names with
the element. This allows you more fine-grained control over what methods of a
given class can be remoted.
All of the code that is discussed in the next section can be seen in action in the webapp seconddwr, which is
part of the source download for this book. One interesting thing to see there that isn??™t discussed here explicitly
is how the call to SigTestClass.convertNames() is done, given that its parameter is a List. Note the
JavaScript array notation used to represent that list.
The element, which is a child of the element, defines that DWR is
allowed to convert a particular class to and from JavaScript, using a specified converter. For
instance, let??™s say you have a class, call it ClassA, and it has a method, creatively called methodA:
package app;
/**
* A class used to demonstrate the bean converter.
*/
public class ClassA {
/**
* This method returns an instance of MyBean, which will be converted to a
* JavaScript object by the bean converter.
Pages:
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173