Forum Stats

  • 3,853,853 Users
  • 2,264,287 Discussions
  • 7,905,483 Comments

Discussions

AM access during Authentication Filter

Filip Huysmans
Filip Huysmans Member Posts: 301 Bronze Badge
edited Jul 18, 2022 4:48PM in JDeveloper and ADF

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

Tagged:
«13

Answers