随笔分类 -  [14] Java/JSP

Java/JSP
摘要:拦截器是在面向切面编程中应用的,就是在你的service或者一个方法前调用一个方法,或者在方法后调用一个方法。是基于JAVA的反射机制。1.拦截器(Interceptor)执行顺序:1) 请求到达 DispatcherServlet2) DispatcherServlet 发送至 Intercept 阅读全文
posted @ 2021-12-28 21:07 emanlee 阅读(284) 评论(0) 推荐(0) 编辑
摘要:@EnableTransactionManagement // 启注解事务管理,等同于xml配置方式的 <tx:annotation-driven /> 关于事务管理器,不管是JPA还是JDBC等都实现自接口 PlatformTransactionManager. 如果你添加的是 spring-bo 阅读全文
posted @ 2021-12-28 19:50 emanlee 阅读(452) 评论(0) 推荐(0) 编辑
摘要:1. MapperScannerConfigurer 作用 MapperScannerConfigurer 是为了解决 MapperFactoryBean 繁琐而生的,有了 MapperScannerConfigurer 就不需要我们去为每个映射接口去声明一个bean了。提高了开发的效率。 2. M 阅读全文
posted @ 2021-12-27 21:21 emanlee 阅读(1352) 评论(0) 推荐(0) 编辑
摘要:IDEA Find in Files 出现乱码: 同样还要再settings中的Eidtor->File Encodings里面设置字体编码格式,一般都是UTF-8,GBK什么的也行 阅读全文
posted @ 2021-12-27 20:27 emanlee 阅读(285) 评论(0) 推荐(0) 编辑
摘要:SqlSessionFactoryBean 配置在基本的 MyBatis 中,session 工厂可以使用 SqlSessionFactoryBuilder 来创建。而在 MyBatis-Spring 中,则使用 SqlSessionFactoryBean 来替代。 SqlSessionFactor 阅读全文
posted @ 2021-12-27 17:47 emanlee 阅读(966) 评论(0) 推荐(0) 编辑
摘要:@WebFilter @WebFilter 用于将一个类声明为过滤器,该注解将会在部署时被容器处理,容器将根据具体的属性配置将相应的类部署为过滤器。 ( value、urlPatterns、servletNames 三者必需至少包含一个,且 value 和 urlPatterns 不能共存,如果同时 阅读全文
posted @ 2021-12-27 16:57 emanlee 阅读(1028) 评论(0) 推荐(0) 编辑
摘要:方法: 在类名上,右键菜单,Diagrams,Show Diagram 线代表的含义 蓝色实线 --> 继承 绿色虚线 --> 实现 红色实现 --> 内部类 idea中查看一个类的调用用和被调用用关系 选中某个方法名称,然后Navigate,Call Hierarchy 阅读全文
posted @ 2021-12-27 16:03 emanlee 阅读(993) 评论(0) 推荐(0) 编辑
摘要:在整个 Spring MVC 框架中,DispatcherServlet 处于核心位置,它负责协调和组织不同组件完成请求处理并返回响应工作。DispatcherServlet 是 Spring MVC 统一的入口,所有的请求都通过它。DispatcherServlet 是前端控制器,配置在 web. 阅读全文
posted @ 2021-12-26 22:52 emanlee 阅读(327) 评论(0) 推荐(0) 编辑
摘要:Spring MVC AbstractAnnotationConfigDispatcherServletInitializer 用于 DispatcherServlet 初始化 DispatcherServlet 是 Spring MVC 的核心组件,它是一个 request 首先到达的地方,负责 阅读全文
posted @ 2021-12-26 22:32 emanlee 阅读(1917) 评论(0) 推荐(0) 编辑
摘要:package com.ita.config; import com.github.pagehelper.PageInterceptor; import org.apache.ibatis.plugin.Interceptor; import org.mybatis.spring.SqlSessio 阅读全文
posted @ 2021-12-26 20:31 emanlee 阅读(1046) 评论(0) 推荐(0) 编辑
摘要:WebMvcConfigurer 配置类其实是Spring内部的一种配置方式,采用JavaBean的形式来代替传统的xml配置文件形式进行针对框架个性化定制。 基于 java-based 方式的 spring mvc 配置,需要创建一个配置类并实现 WebMvcConfigurer 接口,WebMv 阅读全文
posted @ 2021-12-26 19:33 emanlee 阅读(1056) 评论(0) 推荐(0) 编辑
摘要:@PropertySource @PropertySource 注解用于指定资源文件读取的位置,它不仅能读取 properties 文件,也能读取xml文件,并且通过 YAML 解析器,配合自定义 PropertySourceFactory 实现解析YAML文件。 @Component @Prope 阅读全文
posted @ 2021-12-26 18:25 emanlee 阅读(65) 评论(0) 推荐(0) 编辑
摘要:PageHelper 中文乱码 在springmvc 的 mvc:annotation-driven 中配置编码 <mvc:annotation-driven /> 会自动注册DefaultAnnotationHandlerMapping与AnnotationMethodHandlerAdapter 阅读全文
posted @ 2021-12-25 22:52 emanlee 阅读(205) 评论(0) 推荐(0) 编辑
摘要:Taglib指令,其实就是定义一个标签库以及自定义标签的前缀。 这样在界面jsp中引入其中的标签库或者标签库文件,然后才可以正常使用其中定义的标签。 <%@ taglib prefix ="bean" uri= "http://struts.apache.org/tags-bean" %> <%@ 阅读全文
posted @ 2021-12-25 21:14 emanlee 阅读(91) 评论(0) 推荐(0) 编辑
摘要:使用ModelAndView类用来存储处理完后的结果数据,以及显示该数据的视图。从名字上看ModelAndView中的Model代表模型,View代表视图,这个名字就很好地解释了该类的作用。 业务处理器调用模型层处理完用户请求后,把结果数据存储在该类的model属性中,把要返回的视图信息存储在该类的 阅读全文
posted @ 2021-12-25 20:53 emanlee 阅读(1040) 评论(0) 推荐(1) 编辑
摘要:IDEA, SSM: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. project -> c 阅读全文
posted @ 2021-12-25 19:52 emanlee 阅读(201) 评论(0) 推荐(0) 编辑
摘要:SSM三大框架的运行流程、加载顺序 web项目启动的加载顺序:以Tomcat举例,启动Tomcat之后,首先会加载web.xml文件:a)容器首先读取web.xml中的<context-param>的配置内容和<listener>标签中配置项;b)紧接着实例化ServletContext对象,并将< 阅读全文
posted @ 2021-12-25 17:52 emanlee 阅读(670) 评论(0) 推荐(0) 编辑
摘要:${pageContext.request.contextPath} 是通过 get方法去取的,先 pageContext.getRequest() 得到 HttpServletRequest 对象,再调用 HttpServletRequest 的 getContextPath方法 作用是取出部署的 阅读全文
posted @ 2021-12-24 19:59 emanlee 阅读(417) 评论(0) 推荐(0) 编辑
摘要:java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. <dependency> <groupId>org.springframework</groupId> < 阅读全文
posted @ 2021-12-24 16:52 emanlee 阅读(431) 评论(0) 推荐(0) 编辑
摘要:@Override is not allowed when implementing interface method IDEA 菜单 File 菜单 → Project Structure 菜单 → Modules 菜单: 把 Language Leve 版本改成大于 5 就可以了 File 菜单 阅读全文
posted @ 2021-12-24 16:17 emanlee 阅读(33) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示