共 6 篇文章 |
|
logback配置---Spring集成logback.Spring集成logback有个链接:https://github.com/qos-ch/logback-extensions/wiki/Spring.暂时Spring还不直接支持logback,所以需要手动配置上监听器,需要logback-ext-spring-version.jar支持,这个jar包可以到百度网盘:http://pan.baidu.com/share/link?shareid=1639326955&uk=1594827425 下载,也可下... 阅31345 转236 评0 公众公开 14-08-21 19:25 |
在配置文件输入尖括号 " 第一种:联网第二种:将相应的schema文件添加到MyEclipse中。 阅183 转0 评0 公众公开 14-08-06 07:06 |
示例代码:@Controller @RequestMapping("/pets") @SessionAttributes("pet") public class EditPetForm { @RequestMapping(method = RequestMethod.GET) public String setupForm(@RequestParam("petId") int petId, ModelMap model) { Pet pet = this.clinic.loadPet(petId); model.add... 阅4205 转16 评0 公众公开 14-07-11 09:58 |
Spring的四个基本注解annotation(控制层,业务层,持久层) -- @Component、@Repository @Service、@ControllerSpringMVC的四个基本注解annotation(控制层,业务层,持久层) -- @Component、@Repository @Service、@Controller.这里讲的是SpringMVC中这四个注解的作用,其实Srping中这四个注解的作用和SpringMVC一样.@Autowired public ... 阅7926 转20 评0 公众公开 14-07-06 08:49 |
@Controller public class IndexController { @RequestMapping("/index/{username}") public String index(@PathVariable("username") String username) { System.out.POST) public String testParam(HttpServletRequest request, HttpServletResponse response, HttpSession session,@RequestParam(&qu... 阅695 转3 评0 公众公开 14-05-20 11:24 |
Spring的Assert工具类的用法。if (name == null || name.equls("")) { throw new IllegalArgumentException("参数错误!"); } 在所有方法中都使用手工检测合法性的方式并不是太好,因为这样影响了代码的可读性,若使用Assert工具类上面的代码可以简化为: Assert.hasText((name, "参数错误!"); 阅19164 转83 评0 公众公开 14-05-13 17:12 |