title: Dynamic breadcrumb generation - how to do?
body: <p>I'm in the early phases of developing a brand spanking new site with Spring + Tiles. The site needs dynamically generated breadcrumbs.</p>
  
  <p>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:</p>
  
  <pre><code>Products -&gt; Product xyz
  </code></pre>
  
  <p>or the user could reach a product through a customer's order:</p>
  
  <pre><code>Customers -&gt; John Doe -&gt; Orders -&gt; Order 123 -&gt; Product xyz
  </code></pre>
  
  <p>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.</p>
  
  <p>Are there any libraries that I could use?</p>