click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r902382 - in /incubator/click/trunk/click: documentation/docs/roadmap-changes.html framework/src/org/apache/click/ClickServlet.java framework/src/org/apache/click/service/XmlConfigService.java
Date Sat, 23 Jan 2010 11:10:28 GMT
Author: sabob
Date: Sat Jan 23 11:10:27 2010
New Revision: 902382

URL: http://svn.apache.org/viewvc?rev=902382&view=rev
Log:
Added OGNL support for private and protected variables. CLK-599

Modified:
    incubator/click/trunk/click/documentation/docs/roadmap-changes.html
    incubator/click/trunk/click/framework/src/org/apache/click/ClickServlet.java
    incubator/click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java

Modified: incubator/click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/docs/roadmap-changes.html?rev=902382&r1=902381&r2=902382&view=diff
==============================================================================
--- incubator/click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ incubator/click/trunk/click/documentation/docs/roadmap-changes.html Sat Jan 23 11:10:27
2010
@@ -308,7 +308,8 @@
       </li>
       <li class="change">
           Added <a href="click-api/org/apache/click/util/Bindable.html">@Bindable</a>

-          annotation support for page field autobinding
+          annotation support for page field autobinding. @Bindable supports public,
+          protected and private Page variables
           [<a target='_blank' href="https://issues.apache.org/jira/browse/CLK-556">556</a>,

            <a target='_blank' href="https://issues.apache.org/jira/browse/CLK-599">599</a>

           ].

Modified: incubator/click/trunk/click/framework/src/org/apache/click/ClickServlet.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/ClickServlet.java?rev=902382&r1=902381&r2=902382&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/ClickServlet.java (original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/ClickServlet.java Sat Jan 23
11:10:27 2010
@@ -36,6 +36,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
+import ognl.DefaultMemberAccess;
+import ognl.MemberAccess;
 
 import ognl.Ognl;
 import ognl.OgnlException;
@@ -166,6 +168,9 @@
     /** The request parameters OGNL type converter. */
     protected TypeConverter typeConverter;
 
+    /** The OGNL member access handler. */
+    protected MemberAccess memberAccess;
+
     // --------------------------------------------------------- Public Methods
 
     /**
@@ -1161,7 +1166,8 @@
                             || Boolean.class.isAssignableFrom(type))) {
 
                         if (ognlContext == null) {
-                            ognlContext = Ognl.createDefaultContext(page, null, getTypeConverter());
+                            ognlContext = Ognl.createDefaultContext(
+                                page, null, getTypeConverter(), getMemberAccess());
                         }
 
                         PropertyUtils.setValueOgnl(page, name, value, ognlContext);
@@ -1559,6 +1565,19 @@
 
     // ------------------------------------------------ Package Private Methods
 
+    /**
+     * Return the OGNL <tt>MemberAccess</tt>. This method performs a lazy load
+     * of the MemberAccess object, using a {@link DefaultMemberAccess} instance.
+     *
+     * @return the OGNL <tt>MemberAccess</tt>
+     */
+    MemberAccess getMemberAccess() {
+        if (memberAccess == null) {
+            memberAccess = new DefaultMemberAccess(true);
+        }
+        return memberAccess;
+    }
+
    /**
     * Create a Click application ConfigService instance.
     *

Modified: incubator/click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java?rev=902382&r1=902381&r2=902382&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java
(original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/service/XmlConfigService.java
Sat Jan 23 11:10:27 2010
@@ -1688,6 +1688,10 @@
 
             Class parentClass = pageClass.getSuperclass();
             while (parentClass != null) {
+                // Include parent classes up to but excluding Page.class
+                if (parentClass.isAssignableFrom(Page.class)) {
+                    break;
+                }
                 pageClassList.add(parentClass);
                 parentClass = parentClass.getSuperclass();
             }



Mime
View raw message