By corporate mandate I've been using Oracle JDeveloper 10.1.3.1.0.3984, that version number is ridiculous and ought to tell us something, to develop Java EE web applications on and off for about 6 months now and I've never been so frustrated with a development environment in my life. I hear it from seasoned Oracle developers that the wizards are great, you can create web service in a few clicks, you can create an EJB effortlessly, and the application has come such a long way, my God how bad was it before. Honestly, I don't give a flying fuck what you can do with the wizards if the core application is unusable. Coming from an Eclipse/RAD background my gripes are probably slanted, I'm used to being able to do simple things easily and quickly without the IDE flaking out on me completely.
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/*
The biggest time-saver I've stumbled upon in Eclipse is the Open Resource Shortcut. Under the Navigate menu is the Open Resource command, shortcut Ctrl+Shift+R, which opens a window that allows you to type a search for any file that exists in your workspace, in your search you can use the ? to replace a single character or * to replace an entire string, the search is amazingly fast. If you've worked on a project for a long time you know the names of all of your php, jsp's, classes, xml files, and properties, and digging through the folder structure in the Navigator and Project Explorer views can be time consuming and annoying. I've trained my self to use it so much that IDE's that don't have a comparable feature, like JDeveloper, annoy me to no end.
I happened to be in Google Labs today poking around and noticed Google Code Search. If you're looking for a code snippet or example, this beats poking through links in the regular Google search. Just type the snippet that you're looking for and off you are with dozens of examples returned. I've already found tons of Java snippets and examples, next time I'm looking for a code example I'll definitely start here.