摘要: lambada表达式其实是很不错的东西,struts2中,其实OGNL也可以用到, 经常会起到事半功倍的效果,也经常给大家忽视,所以这次小结复习下。选择: collection.{x yyy}其中x为选择操作符,后面是逻辑表达式 ?:选择满足条件的所有元素 ^:满足条件的第1个元素 $:满足条件最后一个元素 比如#customers.{?#this.salary>2000} #cusomers.{^#this.salary>1000} #cusomers.{$#this.salary>1000} 又如,经常要比如SEX为1,0,而显示在前台是要为男和女,这个时候可以在前端少用 阅读全文
posted @ 2012-07-11 09:43 ctou45 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 在php中,__sleep和___wakeup是两个分别自对象序列化前和后分别调用的方法, 其中__sleep在一个对象序列化前调用,它不接收任何参数,但会返回数组,这里可以放置哪些属性需要序列化,比如下面的例子:Java代码 classCustomer{private$name;private$credit_card_number;publicfunctionsetName($name){$this->name=$name;}publicfunctiongetName(){return$this->name;}publicfunctionsetCC($cc){$this-> 阅读全文
posted @ 2012-07-11 09:41 ctou45 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 由于种种关系,虽然spring security 3出了很久了,但还是项目中只能用 spring security 2,发现spring security 2真是十分多东西了,其中比如象在struts2中和轻易写的session管理等,在spring security 2中都要仔细研究文档,花点心思,这里首先推荐两篇网上为数不多的spring security2的中文文档给大家学习,还有代码,先看这两篇:http://www.blogjava.net/redhatlinux/archive/2008/08/20/223148.htmlhttp://www.blogjava.net/redhat 阅读全文
posted @ 2012-07-11 09:40 ctou45 阅读(476) 评论(0) 推荐(0) 编辑