Struts Chapter 10: Exception Handling, Posted for Public Review


News: Struts Chapter 10: Exception Handling, Posted for Public Review

  1. Chapter 10 of the Struts book has been posted for public review on TheServerSide. This chapter will look at how you can properly use the Java exception handling mechanism within your Struts applications to help make your applications more industrial-strength and allow them to gracefully respond when things don't' go as expected.

    Check out Jakarta Struts Book Review Project.
  2. Would someone post a link please?
  3. Here's a link for you.

  4. Tyler,

       Are you working with some kind of browser that can't navigate HTML links? How can I help you?

  5. Opps!. I didn't see the link. My mistake.

  6. What about chapters 7/8 and 9?
  7. They are coming. Chapter 7 should be posted sometime next week. I wrote chapter 10 awhile back and saw no reason not to post it since it has no dependencies on 7,8, or 9.

    Chapter 7 is taking me a little longer than I had hoped. It's a very important chapter and I don't want to screw it up. Instead of making everyone wait the extra time without any new chapters, I went ahead and posted 10.

    It's not uncommon for books of this sort to be written out of order. There are a few others that I will jump ahead and finish and then come back to earlier ones.

    Sorry for the confusion,
  8. Excellent work,

    I am devouring all the chapters and I am anxious to get the rest of them (and the book of course).

    Congratulations! keep the good work.

    ( I will send my comments as requested)

  9. Chuck, will you post source code soon? It's getting a little hard to follow; there are more and more references to classes that we can't see :(

    I am finding this book to be the best resource yet for Struts 1.1.

    I can't wait for chapter 7!

  10. I will post the storefront application, in all it's ugly glory with chapter 7. Keep in mind that the code will most likely change (more functionality) by the time the book is complete. So, everyone will have to accept the code is not finished.

    Chapter 7 is just about finished. I'm just spending a couple of days editing it, trying to catch the typos that I seem to like so well :) Hopefully by the weekend I can get it posted.

    Thanks for the kind words about the material!

  11. Do you have any opinions on the use of Struts ActionErrors in the Model Layer? In other words, would you encourage having business processes setting ActionErrors based on conditions that occur during a given process.
  12. Honestly I would not recommend doing that. The main reason is that coupling the Struts framework to the model layer, which might cause a problem with portability down the road. If you switched to another presentation framework, the business layer would have to be changed. The presentation layer should have a dependency on the model layer, not the other way around.

    The approach I would recommend is to let the business layer throw application (business) exceptions. Either catch these in your Action classes and create the appropriate ActionMessage/ActionError objects for them. Or even better, take advantage of the declarative exception handling capabilities added in 1.1 and let the framework do most of the work.

    The later is the approach that I've used recently in a big application and it works great.