spring boot easyui菜鸟教程(01)——datagrid增删改查

这篇博客介绍了Spring Boot结合EasyUI实现datagrid的增删改查操作,详细讲解了项目结构、Controller的配置以及HTML页面的设计过程。
摘要由CSDN通过智能技术生成

1. 项目结构:
这里写图片描述

2. controller

//查询商品信息,返回json
    @RequestMapping(value = "/findProductJson")
    @ResponseBody
    public List<Product> findProductJson(Map map){
        List<Product> productList=productService.findAll();
        map.put("productList",productList);
        return productList;
    }
    //新增商品信息,重定向到product.save,返回json
    @RequestMapping(value = "/saveProduct",method = RequestMethod.POST)
    public String  saveProduct(Product p){
            productService.save(p);
            return "redirect:/index/findProduct";
    }

3. html页面(easyui)
新增、查询

<head> 
    <link rel="stylesheet" type="text/css" href="../static/easyui/themes/default/easyui.css"  th:href="@{/easyui/themes/default/easyui.css}"/>
    <link rel="stylesheet" type="text/css" href="../static/easyui/themes/icon.css" th:href="@{/easyui/themes/icon.css}"/>
    <link rel="stylesheet" type="text/css" href="../static/easyui/themes/color.css" th:href="@{/easyui/themes/color.css}"/>
    <link rel="stylesheet" type="text/css" href="../static/easyui/demo/demo.css" th:href="@{/easyui/demo/demo.css}"/>
    <script type="text/javascript" src="../static/easyui/jquery.min.js" 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值