Index: BaseControllerTestCase.java
===================================================================
--- BaseControllerTestCase.java	(revision 15)
+++ BaseControllerTestCase.java	(working copy)
@@ -1,14 +1,15 @@
 package org.appfuse.webapp.controller;
 
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Field;
-import java.util.*;
+import java.beans.PropertyDescriptor;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
 
+import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.appfuse.model.BaseObject;
 import org.appfuse.util.DateUtil;
-
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.mail.javamail.JavaMailSenderImpl;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -74,52 +75,48 @@
         objectToRequestParameters(o, request, null);
     }
 
+    private PropertyDescriptor[] getPropertyDescriptors(Class clazz) {
+    	return PropertyUtils.getPropertyDescriptors(clazz);
+    }
+    
     public void objectToRequestParameters(Object o, MockHttpServletRequest request, String prefix) throws Exception {
-        Class clazz = o.getClass();
-        Field[] fields = getDeclaredFields(clazz);
-        AccessibleObject.setAccessible(fields, true);
-
-        for (Field f : fields) {
-            Object field = (f.get(o));
-            if (field != null) {
-                if (field instanceof BaseObject) {
-                    // Fix for http://issues.appfuse.org/browse/APF-429
-                    if (prefix != null) {
-                        objectToRequestParameters(field, request, prefix + "." + f.getName());
-                    } else {
-                        objectToRequestParameters(field, request, f.getName());
-                    }
-                } else if (!(field instanceof List) && !(field instanceof Set)) {
-                    String paramName = f.getName();
-
-                    if (prefix != null) {
-                        paramName = prefix + "." + paramName;
-                    }
+		Class clazz = o.getClass();
+		final PropertyDescriptor[] propertyDescriptors = getPropertyDescriptors(clazz);
+		for (PropertyDescriptor p : propertyDescriptors) {
+			Class type = p.getPropertyType();
+			final String propertyName = p.getName();
+			final Object propertyValue = PropertyUtils.getProperty(o, propertyName);
+			final boolean readable = PropertyUtils.isReadable(o, propertyName);
+			final boolean writeable = PropertyUtils.isWriteable(o, propertyName);
+			//Expose only those properties which is both readable and writeable
+			if (!readable || !writeable) {
+				continue;
+			}
+			if (type.isAssignableFrom(BaseObject.class)) {
+				if (prefix != null) {
+					objectToRequestParameters(propertyValue, request, prefix+ "." + propertyName);
+				} else {
+					objectToRequestParameters(propertyValue, request, propertyName);
+				}
+			} else if (!(propertyValue instanceof List) && !(propertyValue instanceof Set)) {
+				
+				String paramName = propertyName;
 
-                    String paramValue = String.valueOf(f.get(o));
+				if (prefix != null) {
+					paramName = prefix + "." + paramName;
+				}
 
-                    // handle Dates
-                    if (field instanceof Date) {
-                        paramValue = DateUtil.convertDateToString((Date) f.get(o));
-                        if ("null".equals(paramValue)) paramValue = "";
-                    }
+				String paramValue = String.valueOf(propertyValue);
 
-                    request.addParameter(paramName, paramValue);
-                }
-            }
-        }
-    }
-
-    private Field[] getDeclaredFields(Class clazz) {
-        Field[] f = new Field[0];
-        Class superClazz = clazz.getSuperclass();
-        Collection<Field> rval = new ArrayList<Field>();
-        
-        if (superClazz != null) {
-            rval.addAll(Arrays.asList(getDeclaredFields(superClazz)));
-        }
-        
-        rval.addAll(Arrays.asList(clazz.getDeclaredFields()));
-        return rval.toArray(f);
-    }
+				// handle Dates
+				if (propertyValue instanceof Date) {
+					paramValue = DateUtil.convertDateToString((Date) propertyValue);
+					if ("null".equals(paramValue))
+						paramValue = "";
+				}
+				request.addParameter(paramName, paramValue);
+			}
+		}
+	}
+         
 }
