Prev | Current Page 210 | Next

Frank Zammetti

"Practical DWR 2 Projects"

lang.Exception" converter="exception" />
Now, any exception matching this (any descendant of java.lang.exception in this case)
will result in a string of JSON being returned such as this:
{ javaClassName : 'java.io.IOException',
lineNumber : 109,
publicId : 'pid',
message : 'Couldn't read file' }
That??™s clearly a lot more useful to you as a developer! However, you may want something
in between because in a production environment you may well want more information than
the default, but not quite as much as in development. Fortunately, the converter allows you to
have more fine-grained control over what information is presented back to the caller, and
again, it??™s nothing more than some added configuration:



One other thought factors into security here, and that??™s stack trace elements. Returning
stack traces to users, aside from being bad in terms of usability, is a potential security risk. So,
by default, DWR won??™t include stack trace elements. If you??™d like to see that, you need to allow
DWR to marshal them as well by adding this configuration element:
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222