[ 
https://issues.apache.org/jira/browse/WICKET-3931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070434#comment-13070434
 ] 

Martin Grigorov commented on WICKET-3931:
-----------------------------------------

Index: wicket-core/src/main/java/org/apache/wicket/Component.java
===================================================================
--- wicket-core/src/main/java/org/apache/wicket/Component.java  (revision 
1150368)
+++ wicket-core/src/main/java/org/apache/wicket/Component.java  (working copy)
@@ -3807,6 +3807,8 @@
         */
        protected void onDetach()
        {
+               markup = null;
+
                setFlag(FLAG_DETACHING, false);
        }

This fixes the problem. This way the markup is read from the MarkupCache at 
every request and it properly refreshes changes in DEV mode and changes in the 
component variation in DEPLOYMENT mode.
The 'markup' variable is still 'transient' just in case.

> Component markup caching inconsistencies
> ----------------------------------------
>
>                 Key: WICKET-3931
>                 URL: https://issues.apache.org/jira/browse/WICKET-3931
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC5.1
>            Reporter: Martin Grigorov
>         Attachments: variation.tgz
>
>
> In WICKET-3891 we found that Component#markup field is not being reset 
> between requests. The problem is that this field is transient and it is 
> null-ified only when the page is read from the second level page cache (see 
> https://cwiki.apache.org/confluence/x/qIaoAQ). If the page instance is read 
> from first level cache (http session) then its non-serialized version is used 
> and the markup field value is still non-null.
> In WICKET-3891 this looked like a minor issue with the markup caching in 
> development mode but actually this problem is valid even in production mode.
> See the attached application. When the panel's variation is changed every 
> MarkupContainer inside still uses its old markup. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to