Skip to Main Content

Java Development Tools

AM access during Authentication Filter

Filip HuysmansJul 18 2022 — edited Jul 18 2022

Hello everyone,
I've migrated my application from to All works great.
I launch the ViewController Project - Convert to Facelets wizard. It does what it should do.
But after the wizard, launching my application shows some problems.
I have an authentication filter configured which verifies an URL parameter. To do this, it needs access to the database and therefore it uses the AM. Now here lies the problem: since the conversion no AM is available.
Is this still possible to do or do I need to change my way of working?
Some code:


Authentication Filter methods used:

  public void doFilter(ServletRequest servletRequest,
             ServletResponse servletResponse,
             FilterChain filterChain) throws IOException,
                             ServletException {

   ViewObjectImpl view = ADFUtils.getApplicationModule().getUserView();
   // Java way to get the AM, no success
   BindingContext bindingContext = BindingContext.getCurrent();
   DCDataControl dc = bindingContext.findDataControl("AppModuleDataControl");
   AppModuleImpl am = (AppModuleImpl)dc.getDataProvider();
   // Method that worked before the facelets conversion
   return (ApplicationModuleImpl)JSFUtils.resolveExpression("#{data.AppModuleDataControl.dataProvider}");

All help is welcome.
Kind regards,
Filip Huysmans

Post Details
Added on Jul 18 2022