title: How to create a dynamic menu with Spring
body: <p>I want to create a menu from the database.  It will be part of a fragment.... how do I do that?  I have @ModelAttribute("userMenu") and a method that returns a collection of Menu objects, but it seems to return an empty set.</p>
  
  <p>The code can be found at:  <a href="http://pastebin.com/RReU2DgN" rel="nofollow">http://pastebin.com/RReU2DgN</a></p>
  
  <p>So the menu would look like this:  <a href="http://prntscr.com/2blsl6" rel="nofollow">http://prntscr.com/2blsl6</a>  when it's all said and done.</p>
  
  <p>Once I can get the menu data to the view properly, I am hoping to then be able to put it in the fragment to display the menu once a specific type of user logs in.</p>
  
  <p>Any thoughts or suggestions would be helpful.  I have looked through the Spring Framework Reference and I am using the Petclinic model, but it doesn't use dynamic menus.  I've looked at the Yummy example as well and again it doesn't use dynamic menus in the way I am trying to do it.  So if there is an example you can point me to, that would be great as well.</p>