0 Replies Latest reply on Jul 19, 2011 8:49 AM by Fernando Franzini

    JSF 2 is not calling serlvet filter in forward navigation

    Fernando Franzini Newbie

      Hi Folks

       

      My JSF project 2 with mojorra navigate from one page to another without secrets:

       

      1.     <navigation-rule> 
      2.         <navigation-case> 
      3.             <from-outcome>pagina1</from-outcome> 
      4.             <to-view-id>/pagina1.xhtml</to-view-id> 
      5.         </navigation-case> 
      6.     </navigation-rule> 
      7.     <navigation-rule> 
      8.         <navigation-case> 
      9.             <from-outcome>pagina2</from-outcome> 
      10.             <to-view-id>/pagina2.xhtml</to-view-id> 
      11.         </navigation-case> 
      12.     </navigation-rule> 
      13.     <navigation-rule> 

       

      So, I built a servlet filter that intercepts all requests:

       

       

      view plaincopy to clipboardprint?
      1.     <filter> 
      2.         <filter-name>FilterX</filter-name> 
      3.         <filter-class>controle.FiltrarRestricoes</filter-class> 
      4.     </filter> 
      5.      
      6.     <filter-mapping> 
      7.         <filter-name>FilterX</filter-name> 
      8.         <url-pattern>/*</url-pattern> 
      9.         <dispatcher>REQUEST</dispatcher> 
      10.         <dispatcher>FORWARD</dispatcher> 
      11.         <dispatcher>INCLUDE</dispatcher> 
      12.         <dispatcher>ERROR</dispatcher> 
      13.     </filter-mapping> 


      When I click a button jsf, the filter is not running on the exchange page!!
      From what I understand, the filter should be excute twice - one action button in pagina1 and the other by FORWARD navigation on the next page pagina2!
      But this is not happening!! It worked in JSF 1.2! Anyone know why this now?