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 11.1.1.7 to 12.2.1.4. 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:
Web.xml

  <filter-mapping>
    <filter-name>ADFAuthenticationFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>

Authentication Filter methods used:

  @Override
  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

Comments
Post Details
Added on Jul 18 2022
27 comments
195 views