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.

  1. What can I do if DWR is not working for me?
  2. How can I access Java Servlet objects (HttpServletRequest, etc.) in a method remoted by DWR?
  3. How can I compress the Javascript generated by DWR?
  4. Why is DWR not logging exceptions generated from my server code?
  5. How can I prevent DWR from serializing certain fields of a Java Bean?
  6. How can I handle exceptions and errors within my DWR application?
  7. How can I handle Java Collection parameters containing custom Java Beans?
  8. How can I call a remote method that takes a Java Interface or Abstract Class as a parameter?
  9. How do I write the Javascript to pass to a DWR remote call or how do I create Javascript objects to match Java objects?
  10. How can I pass extra data to DWR callback functions?
  11. 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 problems 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 more information.


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