[web] Binding does not work intuitively when a call to another handler is made
------------------------------------------------------------------------------

                 Key: LABS-301
                 URL: https://issues.apache.org/jira/browse/LABS-301
             Project: Labs
          Issue Type: Bug
          Components: Magma
    Affects Versions: Current
            Reporter: Simone Gianni
            Assignee: Simone Gianni
             Fix For: Next


The web binder calls getters on the handler after a do or handle methods 
returns. Unfortunately, this means that the following code :

HandlerA.doSomething 
  this.sessionData = "usethis";
  root().handleB().doSomethingElse();

HandlerB.doSomethingElse
  System.out.println(this.sessionData);

will not work as expected by the user. Since doSomethingElse is called before 
the end of doSomething, the session will not contain the value when it is 
accessed from there.

Another approach is required to achieve this functionality.

A good idea is to weave the getters and setters, and instead ask the user to 
declare the environment variables in handlers as public fields.

This way, the possibility to cache web stuff is still preserved, cause which 
environment variables could be used will still be visible. Also, unit testing 
is still applicable. Moreover, declaring getters and setters would still be 
possible to accomodate other IOC systems.

The Binder would act on get and set joinpoints. This would both solve this bug, 
increase performances because only needed variables are converted, and simplify 
all the web handler mechanics, both for the user and for developers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to