工具
1. idea开发工具
2. 有道词典
3. spring官网:https://spring.io/,建议收藏。
文档
1. Spring中文文档 官网文档中文版,虽然有很多地方翻译不是很准。
2. Servlet3.1规范(最终版) 自己百度搜索有很多免费的,资源重复不能上传。
配置
简单搭建个ssm框架,我们不使用springboot。这里只给出配置信息,信息大家都会。
1.依赖
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.35</version>
</dependency>
tomcat是方便看cataline源码的,可以不引用。
2. web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<!-- Spring监听器 监听加载相关配置文件-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--spring的其他配置文件(包括mybatis配置文件) -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring-context.xml
</param-value>
</context-param>
<!--Spring MVC servlet-->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- 访问根路径时的默认访问页面,从上到下匹配 -->
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
</web-app>
3. spring-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">
<!--mybatis配置-->
<!-- <import resource="classpath*:spring-mybatis.xml"/>-->
</beans>
现阶段不需mybatis。
说明
源码的注释、官方文档,通篇英文,看起来头都大,想学习知识还是要克服的。虽然现在有不少的学习视频,资料可以供大家参考,但平时工作是不会的时候再去查视频,也不一定有相关的内容,有时记得有但不知道在哪,等等原因,要习惯查看文档。