title: Enable JSP Custom taglib to use spring service beans
body: <p>I'm developing a web application using Spring MVC 3.2.4 (Spring Core 3.2.4 too) with jpa &amp; hibernate for the back-end. And currently using Tomcat v6.0 for testing.  </p>
  
  <p>I had a case when i created a JSP custom tag lib (using jsp-api 2.1.1 &amp; servlet-api 2.5), which is a custom lookups drop down list, i would give it the lookup type, and it would get from the DB the items under this type to render as items in the list.   </p>
  
  <p>The custom taglib class basically looks like something similar to this:  </p>
  
  <pre><code>public class LookupsTag extends SimpleTagSupport {
    @Autowired
    private static LookupService lookupService;
    private String type;
  
      public void doTag() throws JspException, IOException {
          List&lt;Lookup&gt; items = lookupService.findByType(getType());
  
          StringBuffer buff = new StringBuffer();
          buff.append("&lt;select&gt;");
          //...adding items...
          buff.append("&lt;/select&gt;");
          getJspContext().getOut().write(buff.toString());
      }
    //getters and setters
  }
  </code></pre>
  
  <p>And i have created the tld file accordingly and all.  </p>
  
  <p>Once i attempt to view a page using this custom tag, a <strong>NullPointerException</strong> is thrown because inside the <em>doTag()</em> method, the <em>lookupService</em> instance is <em>null</em>.</p>
  
  <p>Spring doesn't seem to support custom jsp tags. Is there a way to work around this to make the service instance autowired automatically? Or am i missing some spring configurations to do?</p>
  
  <p>Thanks,</p>