Chapter 13. Best practices
This chapter covers
- Setting up your environment
- Unit-testing your actions
- Building reusable widgets
- Writing custom templates and themes
The book has now covered the essential ingredients you need to start using Struts 2. You might be wondering how to optimally leverage all the capabilities within such a flexible framework, and this chapter is where we set out to answer these questions and more. This chapter contains an assortment of techniques and tips from the trenches. While it isn’t required that you understand this material before writing your first Struts 2 site, it’s strongly encouraged. We liken this chapter to those tips your parents shared with you as a youngster. You didn’t have to apply them right away, but life was simpler when you did. This chapter presents topics ranging from how to optimize your development environment to registering your web features using a wild technique known as wildcard mappings. Of course, there’s also a mishmash of useful tips in between. We present the practices in an easily consumable fashion, so you can take advantage of them right away. Using these practices will minimize the refactoring you might need to do after the application is built.