1 Reply Latest reply on Mar 4, 2011 1:30 PM by lucasmonsterrocha

    Losing Injection feature in CustoSeamFilter

    lucasmonsterrocha Newbie

      HELLOALL,


      the problem is if i've try to use @In(create true) in some attribute, the seam engine couldn't inject the instance and is always returning null.



      @Filter(within = {"org.jboss.seam.web.authenticationFilter"})
      public class FiltroCertificado extends SeamFilter{
      
              @In(create=true)
              private MySeamComponentWithNameAnnotation example;
      
           @Override
           public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
                
                HttpServletRequest httpRequest = (HttpServletRequest)request;
                X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate");          
                
                try {
                     getCertificadoAction().validarCerficadoDigital(certs);
                }catch (Exception e) {
                     e.printStackTrace();
                }
                
                chain.doFilter(request, response);
                
           }
      
           public ValidarCertificadoDigitalAction getCertificadoAction() {
                return new ValidarCertificadoDigitalAction();
           }
      
           
      }
      
      here is my web.xml
      
      <filter>
                <filter-name>Seam Filter</filter-name>
                <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
           </filter>
           <filter-mapping>
                <filter-name>Seam Filter</filter-name>
                <url-pattern>/*</url-pattern>
           </filter-mapping>