写了2个类:
一个是实体bean
public class Order {
private String WorkOrderID;
        public String getWorkOrderID() {
return WorkOrderID;
}
/**
 * @param workOrderID The workOrderID to set.
 */
public void setWorkOrderID(String workOrderID) {
this.WorkOrderID = workOrderID;
}
}
另一个是测试类
public class TestApacheCommonUtils {

public static void main(String[] args) {
Order order = new Order();
                  HashMap map = new HashMap();
                  map.put("WorkOrderID", "12345");
                  try {
                      BeanUtils.populate(order, map);
                  } catch (IllegalAccessException e) {
    e.printStackTrace();
} catch (InvocationTargetException e) {
    e.printStackTrace();
}                   System.out.println(order.getWorkOrderID());
}当运行TestApacheCommonUtils 时,控制台输出是
null按理应该是输出12345啊请用过该包的大侠进来看看,万分感谢