Spring MVC框架下 从后台读取数据库并显示在前台页面【笔记自用 不推荐作为参考】...

1.书写jsp页面  people.jsp

   1.设计显示格式以及内容显示

   2.设计显示内容的范围

2.书写entity实体类 PeopleFormMap.java

   书写传入的参数主要包括 要引用的数据库名 以及主键字段   h_event    id

3.书写service层

   PeopleService  继承底层的 BaseService

4.书写service实现类  PeopleServiceImpl

   @peopleservice

5.书写controller层  PeopleController  Controller实现 界面和service实现类的数据交互

   @RequestMapping(“/people”)

   public class PeopleController extends BaseController{

   private PeopleService peopleservice;

   @ResponseBody

   @RequestMapping("peoplelist")

   public String peoplelist(String txtSelect ) throws Exception{

    return "success";}

}

6.书写js页面

  function initPeopleList(){

     var url= rootPath + '/people/findByPage.shtml';

     书写想要显示字段内容

     封装data{

       }

   }

7.mapping

  书写sql查询语句

   <mapper namespace="RiskForcastMapper">

   <select id="" resultType="java.util.HashMap">

       select * from .....

   </select>

 

 

   

   

转载于:https://www.cnblogs.com/teyues/p/7611462.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值