摘要: 1.用反射技术校验上传图片格式View Code 1 /** 2 * 判断图片格式是否合法,如果图片为空,不合法 3 * @param propertyName 4 * @return 5 * @throws Exception 6 */ 7 public boolean isImageTypeValidate(String propertyName) throws Exception{ 8 PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(t... 阅读全文
posted @ 2012-04-08 21:42 xiao秋 阅读(423) 评论(0) 推荐(0) 编辑
摘要: 1.创建品牌的业务bean,并单元测试View Code 1 package cnblogs.xiaoqiu.bean.product; 2 3 import java.io.Serializable; 4 5 import javax.persistence.Column; 6 import javax.persistence.Entity; 7 import javax.persistence.Id; 8 @Entity 9 public class Brand implements Serializable{10 private static final long seri... 阅读全文
posted @ 2012-04-08 21:34 xiao秋 阅读(509) 评论(0) 推荐(0) 编辑