随笔分类 - springmvc
摘要:HandlerInterceptor接口给我们提供了3个方法: (1)preHandle: 在执行controller处理之前执行,返回值为boolean ,返回值为true时接着执行postHandle和afterCompletion,如果我们返回false则中断执行 (2)postHandle:
阅读全文
摘要:文件的下载功能 @RequestMapping("/testDown")public ResponseEntity<byte[]> testResponseEntity(HttpSession session) throws IOException { //获取ServletContext对象 Se
阅读全文
摘要:创建 maven工程 在pom.xml引入依赖: <dependencies> <!-- SpringMVC --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId>
阅读全文