|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdatabeans.BeanUtilities
Some utilities to populate beans, usually based on incoming request parameters. Requires three packages from the Apache Commons library: beanutils, collections, and logging. To obtain these packages, see http://jakarta.apache.org/commons/. Also, the book's source code archive (see http://www.coreservlets.com/) contains links to all URLs mentioned in the book, including to the specific sections of the Jakarta Commons package.
Note that this class is in the coreservlets.beans package, so must be installed in .../coreservlets/beans/.
Taken from Core Servlets and JavaServer Pages 2nd Edition from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2003 Marty Hall; may be freely used or adapted.
| Constructor Summary | |
BeanUtilities()
|
|
| Method Summary | |
static void |
populateBean(java.lang.Object formBean,
javax.servlet.http.HttpServletRequest request)
Examines all of the request parameters to see if any match a bean property (i.e., a setXxx method) in the object. |
static void |
populateBean(java.lang.Object bean,
java.util.Map propertyMap)
Populates a bean based on a Map: Map keys are the bean property names; Map values are the bean property values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BeanUtilities()
| Method Detail |
public static void populateBean(java.lang.Object formBean,
javax.servlet.http.HttpServletRequest request)
public static void populateBean(java.lang.Object bean,
java.util.Map propertyMap)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||