title: What is the cleanest way to autowire Spring Beans in a JSP?
body: <p>We're currently adding some new features to an old webapp which was using only JSP without any framework for the front. We have added Spring recently, and we would like to autowire our beans in our modified JSP, while not rewriting everything to use SpringMVC, Struts2 or Tapestry5.</p>
  
  <p>We're using autowiring by type, so it leads to get some code like this in the JSP, while previously getting the web application context ( as "wap") :</p>
  
  <pre><code>MyDao myDao = (MyDao) wap.getBeansOfType(MyDao.class).values().toArray()[0];
  </code></pre>
  
  <p>We would like not to use such a code but rather automagically inject our beans directly in our JSPs as we would in a business bean using @Autowired annotation.</p>
  
  <p>In fact we're looking to the cleanest ways to inject our beans in our JSPs. What do you use ?</p>