EasyUI——后台管理系统manager.jsp(自动获取后台写上来的数据,并塞进页面的指定位置,模块化编程,MVC)

最终的图

在这里插入图片描述

数据库创建一个表

在这里插入图片描述
根据上面的表,我们可以写一个简单的easyUI的界面,下面是EasyUI界面的简单的实现

前台代码的实现

首先,我引入了这些,为我下面的页面的搭建做准备

<link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>

看我搭建的页面,代码如下

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
<title>管理员管理</title>
</head>
<body style="margin: 5px;">
	<table id="dg" title="管理员信息管理" class="easyui-datagrid" fitColumns="true" pagination="true"
	pagination="true" rownumbers="true" fit="true" url="managerList">
		<thead>
			<tr>
				<th field="cb" checkbox="true"></th>
				<th field="id" width="8%">编号</th>
				<th field="userName" width="20%">管理员姓名</th>
				<th field="password" width="72%">管理员密码</th>
			</tr>
		</thead>											
	</table>
</body>
</html>
效果图

在这里插入图片描述
值得注意的是,我们的数据库中的表明要和前端界面的id名一致,下面的所有有关这三个元素的都这样命名,就不多累赘的讲了,一定一定要注意一致性,养出好习惯

后台搭建model层的user实体

看图

在这里插入图片描述

代码如下
package model;

/**
 * 用户实体,主要是用于登录的用户实体
 * 为后台管理员登录用的
 * @author 我是一个点
 *
 */
public class User {
   
	
	private int id; // 编号
	private String userName; // 用户名
	private String password; // 密码
	
	
	
	public User() {
   //生成构造方法
		super();//继承父类的
	}
	
	
	public User(String userName, String password) {
   
		this.userName = userName;
		this.password = password;
	}


	public int getId() {
   
		return id;
	}
	public void setId(int id) {
   
		this.id = id;
	}
	public String getUserName() {
   
		<
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值