随笔分类 - SpringMVC
摘要:一、SpringMVC实现文件上传:和Servlet方式的本质一样,都是通过commons-fileupload.jar和commons-io.jarSpringMVC可以简化文件上传的代码,但是必须满足条件:实现MultipartResolver接口;而该接口的实现类SpringMVC也已经提供了
阅读全文
摘要:一、处理模型数据如果跳转时需要带数据:V、M,则可以使用以下方式:MOdelAndView、ModelMap、Map、Model -数据放在了request作用域 put put m.addAttribute(); @SessionAttributes:将数据放到session中,如果要在reque
阅读全文
摘要:一、xml表头信息:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.sprih
阅读全文
摘要:Ajax请求SpringMVC,并且JSON格式的数据 1.首先导包 jackson-annotations.jarjackson-core.jarjackson-databin.jar 2.因为我设置的对应请求的后缀是.html的。 如果是以html为后缀的,返回的默认类型是text/html,而
阅读全文

浙公网安备 33010602011771号