上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页
摘要: 什么是拦截器 Spring MVC中的拦截器(Interceptor)类似于Servlet中的过滤器(Filter),它主要用于拦截用户请求并作相应的处理。例如通过拦截器可以进行权限验证、记录请求信息的日志、判断用户是否登录等。在SpringMVC中通过实现HandlerInterceptor接口实 阅读全文
posted @ 2019-11-12 17:31 林染plus 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 导入依赖 <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> <!-- https://mvnrepository.com/artifact/co 阅读全文
posted @ 2019-11-11 17:14 林染plus 阅读(86) 评论(0) 推荐(0) 编辑
摘要: @ExceptionHandler方式 1.Exception类 . 2.控制层 3.页面层 4.userName和userAge.jsp页面 xml配置方式 controller类 俩个Exception类 xml配置 jsp页面 阅读全文
posted @ 2019-11-11 16:54 林染plus 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 请求参数自动类型转换 <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>登陆</title> </head> <body> <form action="/fourth/oneR 阅读全文
posted @ 2019-11-10 12:56 林染plus 阅读(1079) 评论(0) 推荐(0) 编辑
摘要: ModelAndView的作用以及用法 使用ModelAndView类用来存储处理完后的结果数据,以及显示该数据的视图。从名字上看ModelAndView中的Model代表模型,View代表视图,这个名字就很好地解释了该类的作用。业务处理器调用模型层处理完用户请求后,把结果数据存储在该类的model 阅读全文
posted @ 2019-11-10 12:36 林染plus 阅读(578) 评论(0) 推荐(0) 编辑
摘要: 视图解析器 在spring-mvc文件中编写 <!--配置视图解析器--> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value=" 阅读全文
posted @ 2019-11-10 12:17 林染plus 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 1.SpringMVC请求流程图 SpringMVC案列 1.导入依赖 <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --> <dependency> <groupId>org.springfram 阅读全文
posted @ 2019-11-07 16:57 林染plus 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1.导入所需要的依赖 <!--MyBatis和Spring的整合包 由MyBatis提供--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.3.0</ve 阅读全文
posted @ 2019-11-05 12:21 林染plus 阅读(1554) 评论(1) 推荐(0) 编辑
摘要: 1.导入所需要的jar依赖 !--MyBatis和Spring的整合包 由MyBatis提供--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.3.0</ 阅读全文
posted @ 2019-11-05 12:15 林染plus 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1.entity实体类 2.dao层 3.dao实现类 4.service层 5.serviceimpl层 6.大配置.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/sc 阅读全文
posted @ 2019-11-04 14:10 林染plus 阅读(349) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页