Announcement Announcement Module
Collapse
No announcement yet.
Command Class Object remains in memory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Command Class Object remains in memory

    Hi Everybody,

    I have a problem. We are using AbstractWizradFormController. The problem is that the command object associated with Wizard remains in memory unless the "processCancel()" / "processFinish()" is called.

    Because of this, whenever I exit the wizard without clicking on "Cancel" button, and invoke the Wizards controller again, instead of cerating a new command object, the same object is using causing the wizard to show the page which was left while exiting without using "Cancel".

    Is there any method of the Wizard that can be used for removing the command object from the memory in order to avoid the above mentioned problem ?

    Any help regarding this will be extremely helpful...

    Thanks and Regards,
    Shweta

  • #2
    I had the same issue working with the WizardController.
    I got around it by creating a web filter that on any HTTP get request would clear out any attribute from the session based on the "DEFAULT_COMMAND_NAME". I think I did a check for ".FROM." on the session attribute key and removed it. Also do not forget to clear the current page session attribute at the same time.

    Dmitry

    Comment


    • #3
      Hi there,

      Thanks for your help...but I did not actually understand what you are trying to say here. The session has the attribute named ".FROM." or does it mean anything else. Cause I tried retreiving the attribute named ".FROM."

      I guess I havent really understood what ur trying to say here...

      Regards,
      Shweta

      Comment


      • #4
        Current page is stored in a session with the string returned by getPageSessionAttributeName().

        I just looked at the code and object is stored in the session at:
        Code:
          getClass().getName() + ".PAGE." + getCommandName();
        Command object is stored in the session at key returned by getFormSessionAttributeName()
        Code:
        getClass().getName() + ".FORM." + getCommandName();
        So in you filter you could iterate over session attributes untill you stumble on
        Code:
        if (sessionKey.indexOf(".PAGE.") > 0 || sessionKey.indexOf(".FORM.") > 0)
        session.removeAttribute(sessionKey);
        This will clear the current wizard page from the session and clear the command object.

        Dmitry
        Last edited by dsklyut; Dec 19th, 2005, 12:17 PM.

        Comment


        • #5
          Hi Dmitry,

          Thanks a lot for your help...the code u mentioned worked perfectly well for me...

          I have now written an interceptor for all the controllers except for the ones that use the Wizard, and removed the session attribute from there....

          Thanks once again...

          Regards,
          Shweta

          Comment

          Working...
          X