[ 
https://issues.apache.org/jira/browse/CLK-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844801#action_12844801
 ] 

Bob Schellink commented on CLK-642:
-----------------------------------

Hi Henry,

Forwards are processed immediately by the container and execution returns to 
the original Page after the forward is done. Thus the previous Context object 
is needed to continue processing of the first page eg: onDestroy event handling.

Here is the JIRA which lead to the stack approach: 
https://issues.apache.org/jira/browse/CLK-314

kind regards

bob

> Fix the logic to manage Context with ThreadLocal
> ------------------------------------------------
>
>                 Key: CLK-642
>                 URL: https://issues.apache.org/jira/browse/CLK-642
>             Project: Click
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.2.0
>            Reporter: Henry Saputra
>            Priority: Minor
>         Attachments: context_change.patch
>
>
> Currently, the Context class maintains a ThreadLocal<ContextStack> instance 
> to store all contexts created for each Click request. However since Clck is 
> using  servlet mechanism, each request will be processed in a separate thread 
> so there should be just a single Context in a thread execution lifetime.
> Within a thread scope, we could just use ThreadLocal<Context> to manage a 
> single context  since ThreadLocal guarantee a unique instance per thread.
> I dont think we need to manage the Context instances in ContextStack because 
> there should be only one Context instance per request, which supported by 
> execution in a separate thread for each request and ThreadLocal.
> I created repository for Click in codereview.appspot.com to help with code 
> review and created an entry for this JIRA:
> http://codereview.appspot.com/471041/show

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

Reply via email to