import org.apache.common.beanutils.PropertyUtils
Object obj = PropertyUtils.getNestedProperty(request, propertyPath)
The beanutils package contains a very useful class, PropertyUtils, that you can use to access member values. So in the code below if request was an HTTP request object and the propertyPath was 'request.attribute(myBean).myBeanValue'. The PropertyUtils class would obtain the myBean object from the request attribute map and then call its getter method for the myBeanValue member.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment