spring mvc入门系列(四)

22 篇文章 0 订阅
  1. 04-表现层与前端数据传输

  2. 17-SSM整合(整合配置)

  3. 18-SSM整合(功能模块开发)

  4. 19-SSM整合(接口测试)

  5. 20-SSM整合-表现层与前端数据传输协议定义

  6. 21-SSM整合-表现层与前端数据传输数据协议实现

  1. 17-SSM整合(整合配置)

     

    ssm整合框架搭建 

  2. 18-SSM整合(功能模块开发)

    功能开发完成,对一张表进行增删改查

  3. 19-SSM整合(接口测试)

    接口开发完成要用junit进行测试

    表现层开发完成要用postman做测试

    业务层测试代码

    import com.itheima.config.SpringConfig;
    import com.itheima.domain.Book;
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.test.context.ContextConfiguration;
    import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
    
    import java.util.List;
    
    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(classes = SpringConfig.class)
    public class BookServiceTest {
    
        @Autowired
        private BookService bookService;
    
        @Test
        public void testGetById(){
            Book book = bookService.getById(1);
            System.out.println(book);
        }
    
        @Test
        public void testGetAll(){
            List<Book> all = bookService.getAll();
            System.out.println(all);
        }
    
    }

    用postman测试controller

     

  4. 20-SSM整合-表现层与前端数据传输协议定义

    前端觉得数据格式太多,需要整合格式

    前端和后端人员通讯的协议,确定格式

     

     

     

     

  5. 21-SSM整合-表现层与前端数据传输数据协议实现

     

     

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值