GreatWebGuy Self-proclaimed greatness is a hard thing to prove.

21Mar/0710

An AJAX email contact form using DWR and Scriptaculous

Coming from the Java Server side, my JavaScript skills are pretty limited, a lot of the AJAX frameworks still require a good deal of JavaScript, or wildly complex configurations, not to mention having to take into consideration how you plan to accept and answer the asynchronous calls on the server side. I needed a framework that was easy to configure, was at home in the Servlet Container, and could expose my existing API's to be called asynchronously.

I came across http://getahead.org and their AJAX framework, DWR, and found they had exactly what I needed and at the right price again, free.

Now down to the business of the article. The purpose here is to give some sample source that I worked through in following the directions on GetAhead's website. I had some issues following their directions and figured others might too, some things didn't seem to be working in their examples.

Source for this article is available here: testDWRContactForm.war

Step 1 - Download DWR and add it to your project lib directory
- Download dwr.jar

Step 2 - Add the configuration to load DWR to your web.xml


  dwr-invoker
  DWR Servlet
  org.directwebremoting.servlet.DwrServlet
  
debug
true
  

  dwr-invoker
  /dwr/*