title: Using some beans in Filter bean class?
body: <p>In my filter bean class, I added some beans dependency (with <code>@Autowired</code> annotation). But in the method <code>doFilter()</code>, all my dependency beans have null ...</p>
  
  <pre><code>public class FacebookOAuth implements Filter
  {
  @Autowired
  private BusinessLogger logger;
  
  @Autowired
  private IUserSessionInfo userSessionInfo;
  
  @Autowired
  private FacebookOAuthHelper oAuthHelper;
  
  public void init(FilterConfig fc) throws ServletException
  {
      // Nothing to do
  }
  
  public void doFilter(ServletRequest sr, ServletResponse sr1, FilterChain fc) throws   IOException, ServletException
  {
      // HttpServletRequest req = (HttpServletRequest)sr;
      HttpServletResponse res = (HttpServletResponse) sr1;
  
      String code = sr.getParameter("code");
  
      if (StringUtil.isNotBlankStr(code))
      {
          String authURL = this.oAuthHelper.getAuthURL(code);
  </code></pre>
  
  <p><strong>this.oAuthHelper</strong> is equal at null (and other dependancy beans to) ...</p>
  
  <p>Could you help me ?</p>
  
  <hr>
  
  <p>In fact I don't use MVC notion on server side (Spring). For my side client I use Flex technology and BlazeDS servlet ton communicate with my server.</p>
  
  <p>So, that is the reason, I use the Filter bean notion. </p>
  
  <p>So, how can I handle my session bean notion in my Filter bean ?</p>
  
  <hr>
  
  <p>Skaffman,</p>
  
  <p>I implemented your idea, so I update my application.xml with : </p>
  
  <pre><code>&lt;bean id="FacebookOAuthHandler" class="com.xx.FacebookOAuthHandler" /&gt;
  &lt;bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt;
      &lt;property name="mappings"&gt;
      &lt;props&gt;
         &lt;prop key="/fbauth"&gt;FacebookOAuthHandler&lt;/prop&gt;         
      &lt;/props&gt;
     &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and my <strong>FacebookOAuthHandler</strong> class :</p>
  
  <pre><code>public class FacebookOAuthHandler extends AbstractController
  {
  @Autowired
  private BusinessLogger logger;
  
  @Autowired
  private IUserSessionInfo userSessionInfo;
  
  @Autowired
  private FacebookOAuthHelper oAuthHelper;
  
  @Override
  protected ModelAndView handleRequestInternal(HttpServletRequest request,
          HttpServletResponse response) throws Exception {
  
      // TODO
  
      return null;
  }
  </code></pre>
  
  <p>But, this method <strong>handleRequestInternal</strong> is never called when my URL is : <a href="http://xx.xx.xx.xx/MyApp/fbauth" rel="noreferrer">http://xx.xx.xx.xx/MyApp/fbauth</a></p>