今日知识

1. Spring整合MyBatis
2. SSM普通整合
3. SSM整合(Spring和SpringMVC分离)
4. 纯JavaConfig的SSM

Spring整合MyBatis

1. 导包
<properties>
<spring.version>5.1.8.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.6</version>
</dependency>
<!--mybatis的spring支持包-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.2</version>
</dependency>
<!--连接数据库的四个包-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.16</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
</dependency>
<!--test-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
2. 创建UserMapper接口
public interface UserMapper {
public User selectByPrimaryKey(int id);
}
3. 创建UserService接口
public interface UserService {
public User selectByPrimaryKey(int id);
}
4. 创建UserMapperImpl实现类
@Component
public class UserServiceImpl implements UserService {
@Autowired
UserMapper userMapper;
public User selectByPrimaryKey(int id) {
return userMapper.selectByPrimaryKey(id);
}
}
5. UserMapper.xml创建
<mapper namespace="com.rqy.mapper.UserMapper">
<resultMap id="BaseResultMap" type="com.rqy.domain.User">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="birthday" jdbcType="DATE" property="birthday" />
<result column="sex" jdbcType="CHAR" property="sex" />
<result column="address" jdbcType="VARCHAR" property="address" />
/resultMap>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
*
from user
where id = #{id,jdbcType=INTEGER}
</select>
</mapper>
6. application.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"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd"> <context:component-scan base-package="com.rqy"/>
<!--<mvc:annotation-driven/>-->
<!--数据源-->
<bean id="datasource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatisday01?serverTimezone=UTC"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>
<!--1.1.2 配置sqlSessionFactory-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="datasource"/>
<!--<property name="configLocation" value="classpath:SqlMapConfig.xml"/>-->
</bean>
<!--MapperFactoryBean,缺点每个mapper接口都要注册进来--> <!--<bean id="userMapper" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.rqy.mapper.UserMapper"/>
&lt;!&ndash;sqlSessionFactory注入到mapper中,代替mapper实现类&ndash;&gt;
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>--> <!--把整个mapper接口所在的包都注册进来-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--扫描包,取代了SqlMapConfig.xml mapper映射文件-->
<property name="basePackage" value="com.rqy.mapper"/>
<!--与上面不太一样-->
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>
</beans>
7. 测试
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:application.xml")
public class MyTest {
@Autowired
UserService userService;
@Test
public void test(){
User user = userService.selectByPrimaryKey(35);
System.out.println(user);
}
}

SSM普通整合

1. 导包(数据源的包采用的druid的,你也可以采用其他的额)
<properties>
<spring.version>5.1.8.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.6</version>
</dependency>
<!--mybatis的spring支持包-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.2</version>
</dependency>
<!--连接数据库-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.16</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.11</version>
</dependency>
<!--test-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!--jackson-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.7</version>
</dependency>
</dependencies>
2. 创建UserMapper接口
public interface UserMapper {
public User selectByPrimaryKey(int id);
}
3. 创建UserService接口
public interface UserService {
public User selectByPrimaryKey(int id);
}
4. 创建UserMapperImpl实现类
@Component
public class UserServiceImpl implements UserService {
@Autowired
UserMapper userMapper;
public User selectByPrimaryKey(int id) {
return userMapper.selectByPrimaryKey(id);
}
}
5. UserMapper.xml创建
<mapper namespace="com.rqy.mapper.UserMapper">
<resultMap id="BaseResultMap" type="com.rqy.domain.User">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="birthday" jdbcType="DATE" property="birthday" />
<result column="sex" jdbcType="CHAR" property="sex" />
<result column="address" jdbcType="VARCHAR" property="address" />
/resultMap>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
*
from user
where id = #{id,jdbcType=INTEGER}
</select>
</mapper>
6. application.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"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-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/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"> <context:component-scan base-package="com.rqy"/>
<mvc:annotation-driven/>
<!--数据源-->
<bean id="datasource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatisday01?serverTimezone=UTC"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>
<!--1.1.2 配置sqlSessionFactory-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="datasource"/>
</bean>
<!--把整个mapper接口所在的包都注册进来-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--扫描包,取代了SqlMapConfig.xml mapper映射文件-->
<property name="basePackage" value="com.rqy.mapper"/>
<!--与上面不太一样-->
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
7. Web.xml
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
8. UserController.java
@Controller
public class UserController {
@Autowired
UserService userService;
@RequestMapping("user")
public @ResponseBody User query(int id){
User user = userService.selectByPrimaryKey(id);
System.out.println(user);
return user;
}
}

SSM整合(Spring和SpringMVC分离)

1. 导包(和上面一样)
2. 创建UserMapper接口(和上面一样)
3. 创建UserService接口(和上面一样)
4. 创建UserMapperImpl实现类(和上面一样)
5. UserMapper.xml创建(和上面一样)
6. application.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"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-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/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"> <context:component-scan base-package="com.rqy">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<!--数据源-->
<bean id="datasource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatisday01?serverTimezone=UTC"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>
<!--1.1.2 配置sqlSessionFactory-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="datasource"/>
</bean> <!--把整个mapper接口所在的包都注册进来-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!--扫描包,取代了SqlMapConfig.xml mapper映射文件-->
<property name="basePackage" value="com.rqy.mapper"/>
<!--与上面不太一样-->
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>
<!--测试的bean,项目初始化的时候就会执行-->
<bean class="com.rqy.domain.SpringBean"/>
</beans>
7. application-mvc.xml
<!--扫描包这个配置在springmvc的容器中不能去掉-->
<context:component-scan base-package="com.rqy.controller">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
<mvc:annotation-driven/>
<!--测试的bean,当有url请求的时候才会执行-->
<bean class="com.rqy.domain.MvcBean"/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
8. Web.xml(分别把application.xml和application-mvc.xml配置进去)
<!--通过listner注册spring容器,父容器-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application.xml</param-value>
</context-param> <servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:application-mvc.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
9. UserController.java
@Controller
public class UserController {
@Autowired
UserService userService;
@RequestMapping("user")
public @ResponseBody User query(int id){
User user = userService.selectByPrimaryKey(id);
System.out.println(user);
return user;
}
}

纯JavaConfig的SSM整合

思想:

1. 取消了application.xml和application-MVC.xml以及web.xml,
2. 用了一个继承AbstractAnnotationConfigDispatcherServletInitializer的类来实现具体文件配置
1. AppInitialize继承AACDSi类的书写
public class AppInitialize extends AbstractAnnotationConfigDispatcherServletInitializer {
//SpringConfig指的是spring配置文件
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[]{SpringConfig.class};
}
//SpringMvcConfig指的是springMvc配置文件
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[]{SpringMvcConfig.class};
}
//配置sevlet请求路径/就OK了
@Override
protected String[] getServletMappings() {
return new String[]{"/"};
}
//配置编码过滤器
@Override
protected Filter[] getServletFilters() {
CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();
characterEncodingFilter.setEncoding("utf-8"); return new Filter[]{characterEncodingFilter};
}
}
2. SpringConfig类的书写
@Configuration
@ComponentScan(value = "com.rqy",
excludeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Controller.class}))
@EnableTransactionManagement
@EnableAspectJAutoProxy
public class SpringConfig { //dataSource,必要
@Bean
public DataSource druidDatasource(){
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setDriverClassName("com.mysql.jdbc.Driver");
druidDataSource.setUrl("jdbc:mysql://localhost:3306/mybatisday01");
druidDataSource.setUsername("root");
druidDataSource.setPassword("123456");
return druidDataSource;
} //SqlSessionFactoryBean 必要
@Bean
public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource){
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSource);
return sqlSessionFactoryBean;
}
//MapperScannerConfigurer 必要
@Bean
public MapperScannerConfigurer mapperScannerConfigurer(){
MapperScannerConfigurer mapperScannerConfigurer =new MapperScannerConfigurer();
mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactoryBean");
mapperScannerConfigurer.setBasePackage("com.rqy.mapper");
return mapperScannerConfigurer;
}
//文件的上传的配置,有需要才配置
@Bean
public CommonsMultipartResolver multipartResolver(){
CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
commonsMultipartResolver.setMaxInMemorySize(5240000);
return commonsMultipartResolver;
}
//配置事务管理器,同时要开启注解
@Bean
public DataSourceTransactionManager transactionManager(DataSource dataSource){
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager();
dataSourceTransactionManager.setDataSource(dataSource);
return dataSourceTransactionManager;
}
}
3. SpringMvcConfig配置需要实现WebMvcConfigurer接口
@EnableWebMvc
@ComponentScan(value = "com.rqy.controller",
includeFilters =@ComponentScan.Filter(type = FilterType.ANNOTATION,classes = Controller.class) )
public class SpringMvcConfig implements WebMvcConfigurer{
<!--实现date的转换开始-->
//注入本身已有的接口
@Autowired
ConfigurableConversionService conversionService;
//把自定义的conversionService重新注册到bean中
@Bean
//保证conversionService的唯一性
@Primary
public ConfigurableConversionService conversionService(){
return conversionService;
}
//指定执行顺序
@PostConstruct
public void addConverters(){
String2DateConverter string2DateConverter = new String2DateConverter();
conversionService.addConverter(string2DateConverter);
}
<!--实现date的转换结束-->
<!--实现过滤器的配置-->
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new MyFirstInterceptor());
//registry.addInterceptor().addPathPatterns("/abc/**");
}
<!--实现静态资源的配置-->
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/pic/**").addResourceLocations("file:D:/pic/");
registry.addResourceHandler("/pic/**").addResourceLocations("classpath:/pic/");
registry.addResourceHandler("/pic/**").addResourceLocations("/WEB-INF/pic");
}
//配置视图解析器
@Bean
public InternalResourceViewResolver internalResourceViewResolver(){
InternalResourceViewResolver internalResourceViewResolver = new InternalResourceViewResolver();
internalResourceViewResolver.setPrefix("/WEB-INF/views/");
internalResourceViewResolver.setSuffix(".jsp");
return internalResourceViewResolver;
}
}
4. 导包
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.8.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.2</version>
</dependency>
<!--aspectj-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>5.0.2.RELEASE</version>
</dependency>
<!--mybatis对spring的支持包-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.3.2</version>
</dependency>
<!--数据源和mysql驱动-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.11</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.1.8.RELEASE</version>
</dependency>
<!--test-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.8.RELEASE</version>
</dependency>
<!--jackson-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.7</version>
</dependency>
<!--文件上传的包-->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.3</version>
</dependency>
</dependencies>
5. 日期格式的转换
public class String2DateConverter implements Converter<String,Date> {
@Override
public Date convert(String s) {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
try {
Date date=sdf.parse(s);
return date;
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
}
6. 过滤器的实现
public class MyFirstInterceptor  implements HandlerInterceptor{
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
System.out.println("preHandle");
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
System.out.println("postHandle");
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { }
}
7. 创建UserMapper接口(和上面一样)
8. 创建UserService接口(和上面一样)
9. 创建UserMapperImpl实现类(和上面一样)
10. UserMapper.xml创建(和上面一样)一般通过你工程来完成
11. UserController测试类
@Controller
public class UserController {
@Autowired
UserService userService;
@RequestMapping("user")
@ResponseBody
public User query(int id, Model model){
User user = userService.selectByPrimaryKey(id);
model.addAttribute("user",user.toString());
return user;
}
}

14-SSM整合的更多相关文章

  1. SSM整合框架实现ajax校验

    SSM整合框架实现ajax校验   刚学习了ssm框架,ajax校验成功,分享下 1.导入jar包

  2. SSM整合activiti框架

    一:WorkFlow简介 1:什么是工作流工作流(Workflow),指“业务过程的部分或整体在计算机应用环境下的自动化”.是对工作流程及其各操作步骤之间业务规则的抽象.概括描述.在计算机中,工作流属 ...

  3. java web开发入门八(ssm整合)基于intellig idea

    ssm整合 一.导入相关包 二.开发流程 1.写entity package com.eggtwo.euq.entity; import java.io.Serializable; import ja ...

  4. 08 SSM整合案例(企业权限管理系统):06.产品操作

    04.AdminLTE的基本介绍 05.SSM整合案例的基本介绍 06.产品操作 07.订单操作 08.用户操作 09.权限控制 10.权限关联与控制 11.AOP日志 06.产品操作 SSM 环境搭 ...

  5. Day01_企业权限管理(SSM整合)

    学于黑马程序员和传智播客联合做的教学项目 感谢 黑马程序员官网 传智播客官网 个人根据教程的每天的工作进度的代码和资料 密码:cti5 b站在线视频 微信搜索"艺术行者",关注并回 ...

  6. 五天一体_企业权限管理(SSM整合)

    学于黑马程序员和传智播客联合做的教学项目 感谢 黑马程序员官网 传智播客官网 个人根据教程的每天的工作进度的代码和资料 密码:cti5 b站在线视频 微信搜索"艺术行者",关注并回 ...

  7. 【环境搭建】SSM 整合使用

    SSM 整合使用 文章源码 搭建整合环境 整合说明 SSM 整合可以使用多种方式,但是选择 XML + 注解 的方式最为合适. 整合思路 搭建整合环境 Spring 环境搭建并测试 Spring 整合 ...

  8. Maven + 最新SSM整合

    . 1. 开发环境搭建 参考博文:Eclipse4.6(Neon) + Tomcat8 + MAVEN3.3.9 + SVN项目完整环境搭建 2. Maven Web项目创建 2.1. 2.2. 2. ...

  9. SSM整合配置

    SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis) 使用SSM(Spring.SpringMVC和Mybatis)已经有三个多月了,项目在技术上已经没有什么难点了,基于现有 ...

  10. SSM整合中遇到的不能扫描注解的bug

    我的开发环境为: ubuntu14.04LTS 64bit; Spring Tool Suite  3.5.0.RELEASE Maven 3.2.3 SSM整合中遇到的不能扫描注解的bug 最终解决 ...

随机推荐

  1. Scanner使用方法

    import java.util.Scanner; //导入包 public void main (String args[]){ Scanner a=new Scanner(System.in); ...

  2. java通过word模板生成word文档

    介绍 上次公司项目需要一个生成word文档的功能,有固定的模板根据业务填充数据即可,由于从来没做过,项目也比较着急于是去网上找有没有合适的工具类,找了好几种,看到其中有freeMark模板生成比较靠谱 ...

  3. 求1-n 中与 m 互质的素因子 (容斥原理)

    ll prime[100]; ll cnt; void getprime(){ cnt = 0; ll num = m; for(ll i = 2; i*i <= m; i++){ // sqr ...

  4. spring boot部署中executable的系统服务

    首先在pom.xml 中添加spring boot插件,并设置 <plugins> <plugin> <groupId>org.springframework.bo ...

  5. .net Core Autofac稍微高级一点的方法

    前情摘要 前段时间写了autofac的注入但是每次都需要去修改startup这应该不是大家想要的. 至少不是我想要的. 网上有朋友说可以创建一个基础类来时间. 好了吹牛时间结束我们开始干点正事. 创建 ...

  6. xlwings excel(三)

    App相当于Excel程序,Book相当于工作簿.N个Excel程序则由apps表示,N个工作簿由books表示. 对工作簿的操作 #导入xlwings模块 import xlwings as xw ...

  7. BOZJ-2590 优惠券

    BOZJ-2590 优惠券 题目: 约翰需要买更多的奶牛!交易市场上有n头奶牛等待出售,第ii头奶牛的原价是\(p_i\)元,使用优惠券之后,折扣价为\(c_i\)元.约翰有m元钱和k张优惠券.请问约 ...

  8. 分享一下我在mysql5.6+mysql8数据库安装过程中的一些坑!

    Mysql5.6安装 下载好安装包后,在bin目录下用cmd打开,输入mysqld install [服务名]新建个服务 在windows+r输入services.msc即可查看服务 怎样使用mysq ...

  9. python中[-1]、[:-1]、[::-1]、[n::-1]使用方法

    import numpy as np a=np.random.rand(5) print(a) [ 0.64061262 0.8451399 0.965673 0.89256687 0.4851874 ...

  10. pku-3321 Apple Tree(dfs序+树状数组)

    Description There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow ...