特别鸣谢
首先特别鸣谢【Jintao_Ma】老师,给予启发,终于在Spring探索的路上有了实质性的进展
再次感谢!🙏
背景
代码生涯已过三个年头,相关的工作是做了个七七八八。 从需求调研到服务器上线维护,从UI切图-到数据库设计-到前后台代码编写,从PC端到移动端,还接触过小程序…林林总总,多多少少是都有过经历的。但这也埋下了隐患,多而不精。 特别现阶段,进入瓶颈期已有时日。终究不能突破,换句话说应该是不想突破。路也明朗,就是要深耕。 就是要去接受源码的洗礼,能否涅槃,能否渡过此劫,此为必经之路。
借此文档,一来,简记学习过程,方便此后复习。二来,能用此方式激励自己,并接受形式上的监督。
Come on, let’s grow together!!
环境搭建
创建项目
- 利用maven命令行创建一个项目:
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=myapp -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Spring配置文件
在src/main,src/test建立resources文件,使之成为标准的maven java项目
Spring配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">
<bean id="app" class="com.mycompany.app.App"></bean>