共 12 篇文章 |
|
阅2170 转1 评0 公众公开 15-06-03 10:23 |
阅215 转0 评0 公众公开 15-06-03 09:39 |
Apache Commons工具集简介。// 2、 将一个Map对象转化为一个Bean // 这个Map对象的key必须与Bean的属性相对应。//将map转化为一个Person对象 Person person = new Person(); BeanUtils.populate(person,map); // 通过上面的一行代码,此时person的属性就已经具有了上面所赋的值了。// 将一个Bean转化为一个Map对象了,如下: Map map = BeanUti... 阅13 转0 评0 公众公开 15-06-03 09:35 |
阅1022 转5 评0 公众公开 15-06-01 10:56 |
阅260 转1 评0 公众公开 15-05-19 10:42 |
request.getRealPath()详解1、此方法已过时,现在可替换的实现方法有。exper1.txt,位于 C:\Tomcat 6.0\webapps\ROOT,context.getRealPath(“exper1.txt”)结果为C:\Tomcat 6.0\webapps\ROOT\exper1.txt;context.getRealPath(“exper2.txt”)结果为C:\Tomcat 6.0\webapps\ROOT\exper2.txt;context.getRealPath(“exper3.txt”)结果仍为C:\T... 阅24 转0 评0 公众公开 15-05-19 10:34 |
html文本框不可编辑,禁止用户修改的几种方法。Html代码<input type="text" value="readonly" readonly> <input type="text" value="readonly" readonly>Html代码<input type="text" value="disabled" disabled> <input type="text" value=&q... 阅1476 转3 评0 公众公开 15-05-19 10:33 |
commons-beanutils的入门用法 在开发过程中,通常会遇到一些特殊的需求,比如拷贝对象,不同类的对象之间设置公有属性的值等,apache的开源框架commons-beanutils提供了强大的支持,该框架广泛用于其他框架中如struts,hibernate,spring中。1-1、对象克隆 Huma huma=new Huma(); huma.age=3; Huma huma2=(Huma)BeanUtils.cloneBean(huma); ... 阅275 转1 评0 公众公开 15-05-05 23:37 |
[转]BeanUtils接口和类。Commons BeanUtils的源码下载地址:org.apache.commons.beanutils.converters – 转换String到需要类型的类,实现Converter接口。org.apache.commons.beanutils.locale – beanutils的locale敏感版本。BeanUtils类的实例化实现,区别于BeanUtils的静态方法方式,使得自定义的配置得以保持。我们不妨把BeanUtils的基础应... 阅434 转0 评0 公众公开 15-05-05 23:34 |
原]Commons- BeanUtils学习笔记。其中BeanUtils的populate方法(Struts用于将一个map的值填充到一个bean中)或者getProperty,setProperty方法其实都会调用convert进行转换。// 动态取得 System.out.println(BeanUtils.getProperty( test, "name" ));// BeanUtils.setProperty( bean, name, value ) BeanUtils.setPrope... 阅23 转0 评0 公众公开 15-05-05 23:30 |