I'm in the early phases of developing a brand spanking new site with Spring + Tiles. The site needs dynamically generated breadcrumbs.
What I mean by dynamic is that the user may reach a certain site from multiple starting points. If I have views for Customers, Orders and Products, the user could reach a Product directly:
Products -> Product xyz
or the user could reach a product through a customer's order:
Customers -> John Doe -> Orders -> Order 123 -> Product xyz
What is the best way to achieve breadcrumbs like these in a java environment? I've previously done this by using a request attribute (a Vector of Url objects) that is filled with the Urls in each action/servlet of my webapp (like in the action List of Products). I'm not happy with this solution as it requires adding code to each controller/action for generating the breadcrumb trail. And in a case like viewing a product of given order of given customer, the if-then-else logic needed to determine the trail is awful.
Are there any libraries that I could use?