Wednesday, February 11, 2009

BlazeDS Getting Started App Revisited

As some of you may or may not have noticed, I don't get a chance to blog much these days... managing a fair sized team of developers and maintaining our streak of successful projects tends to keep me very busy. But in recent weeks I've started doing some BlazeDS project work again, and I find that to get my head back "in the game" I like to have a project I can pull up and jump right into, so to speak.

If you've been following my blog you'll know that although I'm a huge Flex guy, Java tends to be something I perceive more as a necessity in getting the job done. I've never been a full time hard core Java developer (my brother takes the honors in that category) and so, most of my posts regarding Java or Hibernate are through the eyes of someone who HAS to know enough to be dangerous.

Now I know that anyone could probably do this, but I figured I'd just put it out there, and maybe save someone the trouble... I've put together a little zip file that contains a Tomcat 5.5.x web app, which consists of a Flex project and a Java project, both of which can be opened in Eclipse. Basically the 2 apps work together to demonstrate:

  • using JNDI to declare database and SMTP services
  • launching HSQLDB in memory inside the web app (gets tiring installing mysql just to play around - I borrowed this from the BlazeDS turnkey solution and tweaked it a bit)
  • using a .property file to store configuration values and then retrieving those from Java
  • doing a very simple "is flex talking to blaze" function
  • doing a quick "is blaze talking to the db" function
  • doing a quick "send email from Flex thru Java to me" function
  • uploading files from Flex to Java and from html to Java
  • the minimum number of jar files needed to pull this off (updated to Blaze 3.2.x)
For me personally these are all really nice to have right at my fingertips. There's additional notes in the zip in the index.htm. Enjoy. You can find the zip file here: http://www.crazedcoders.com/demos/blazeMsg.zip

Keep in mind you may need to adjust your paths in your Flex, as chances are your Tomcat install won't be in the same location as I have it on my Mac.

No comments: