0 Replies Latest reply: Feb 20, 2014 7:12 AM by Ravi91349 RSS

Controller (processRequest & processFormRequest) Executing more then once

Ravi91349 Newbie
Currently Being Moderated

Hi,

 

I'm struggling to find out the reason for executing controller (processRequest & processFormRequest) more then once for the very first time loading the page.

 

Here is the code I'm using:

 

Controller

 

      public void processRequest(OAPageContext pageContext, OAWebBean webBean)

  {

    super.processRequest(pageContext, webBean);

     

      System.out.println("CO- -10");

              

       if (!pageContext.isBackNavigationFired(false))

       {

          System.out.println("CO- -20");

         TransactionUnitHelper.startTransactionUnit(pageContext, "empCreateTxn");

          if (!pageContext.isFormSubmission())

          {

              System.out.println("CO- -30");

              OAApplicationModule am = pageContext.getApplicationModule(webBean);

              am.invokeMethod("createEmployee", null);              

           }

      }

       else 

       {

           System.out.println("CO- -60");

         if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "empCreateTxn",    true))

              {

                  System.out.println("CO- -70");

                OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);

                pageContext.redirectToDialogPage(dialogPage);

              }

       }

  }

 

 

Result

 

14/02/20 15:02:47 CO- -10

14/02/20 15:02:47 CO- -20

14/02/20 15:02:47 CO- -30

14/02/20 15:02:47 CO- -10

14/02/20 15:02:47 CO- -20

14/02/20 15:02:47 CO- -30

 

Could you please advice, where it went wrong.

 

Thanks,

Ravi

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points