摘要: 在Spring MVC里,@ModelAttribute通常使用在Controller方法的参数注解中,用于解释model entity,但同时,也可以放在方法注解里。如果把@ModelAttribute放在方法的注解上时,代表的是:该Controller的所有方法在调用前,先执行此@ModelAt... 阅读全文
posted @ 2014-11-28 10:36 横渡 阅读(62249) 评论(3) 推荐(4) 编辑
摘要: Spring MVC中的Interceptor与Struts2的差不多。下面是一个简单的Interceptor登陆验证例子:1、需要在spring的配置文件中加入这段: 2、LoginInterce... 阅读全文
posted @ 2014-11-28 10:26 横渡 阅读(9644) 评论(1) 推荐(0) 编辑