Answers to Common DWR Questions
This is a list of common questions we have received on the DWR mailing list over the last few years. All of these questions have been covered in the DWR documentation and we have provided links to the associated sections to help expedite your search.
- What can I do if DWR is not working for me?
- How can I access Java Servlet objects (HttpServletRequest, etc.) in a method remoted by DWR?
- How can I compress the Javascript generated by DWR?
- Why is DWR not logging exceptions generated from my server code?
- How can I prevent DWR from serializing certain fields of a Java Bean?
- How can I handle exceptions and errors within my DWR application?
- How can I handle Java Collection parameters containing custom Java Beans?
- How can I call a remote method that takes a Java Interface or Abstract Class as a parameter?
- How do I write the Javascript to pass to a DWR remote call or how do I create Javascript objects to match Java objects?
- How can I pass extra data to DWR callback functions?
- How can I handle scope issues in DWR callback functions?
What can I do if DWR is not working for me?
Please see our common problem page to view information on troubleshooting and solving common problems.
Back to the top
How can I access Java Servlet objects (HttpServletRequest, etc.) in a method remoted by DWR?
There are several ways to do this, please see DWR Java API for more information.
Back to the top
How can I compress the Javascript generated by DWR?
DWR automatically compresses the Javascript it generates using ShrinkSafe or the YUI compressor if found in the classpath - no additional configuration from the user is necessary. Please see the documentation for more information.
Back to the top
Why is DWR not logging exceptions generated from my server code?
By default DWR does not log your exceptions. Please see the page on logging for information on setting up the AuditLogAjaxFilter which will enable logging of your exceptions.
Back to the top
How can I prevent DWR from serializing certain fields of a Java Bean?
Please see the bean converter documentation and the section titled Restricting Property Conversion for more information.
Back to the top
How can I handle exceptions and errors within my DWR application?
Please see the information on error handling.
Back to the top
How can I handle Java Collection parameters containing custom Java Beans?
Please see the information on DWR Signatures.
Back to the top
How can I call a remote method that takes a Java Interface or Abstract Class as a parameter?
This can be accomplished using DWR's class mapping feature. Please see the bean converter documentation and the section titled Mapping Java classes to JavaScript classes for more information.
Back to the top
How do I write the Javascript to pass to a DWR remote call or how do I create Javascript objects to match Java objects?
Please see Creating Javascript objects to match Java objects.
Back to the top
How can I pass extra data to DWR callback functions?
Please see Passing Extra Data to Callbacks.
Back to the top
How can I handle scope issues in DWR callback functions?
Please see Passing Extra Data to Callbacks - A word about scope.
Back to the top