title: Spring Security: Step by Step
body: <p>I started on Spring a few months back and the Security topic seems the most complex to me. With Acegi moving into Spring I could not find a single tutorial that tells step by step way to add security to a Spring app. Please help me. My requirements are as follows:</p>
  
  <ul>
  <li>I have several roles in application, they are not hierarchical roles (meaning Role A not necessarily have all roles of Role B etc). </li>
  <li>I want to integrate it to use my own User table where I would store Username, encrypted password (one way encryption) and I want to use either Hibernate or any Spring inbuilt component (read the class name JdbcDaoImpl somewhere, have no clue how to use it though) to access the DB data. </li>
  <li>I probably don't want method level security because I want to use Spring taglibs to selectively show/hide menu items, however there should be way to prohibit unauthorized user to access a page directly through URL.</li>
  </ul>
  
  <p>I don't want ready made code, (<a href="http://www.logicace.com/JavaSample/sample/link?linkId=1" rel="nofollow noreferrer">this tutorial</a> for example confused me to hell, since it doesn't even have Spring security name-space declaration in security.xml), I would appreciate rather a step-by-step guide on how to achieve the above in a Spring2.5/Hibernate3 application using Spring security.</p>
  
  <p>Thanks for your time.</p>