Driving school background management system based on spring, mvc and easy UI

 It has been two months since I arrived at the company, and it is my first time to take over the project. I would like to share with you my experience.

I don't have many tasks, mainly to write a blacklist of driving schools: to realize the functions of adding, modifying, locking and unlocking.

There are three useful package classes for me: the business logic class under the service package, the url addressing class under the controllor package, and the jsp interface

The jsp interface mainly uses the datagrid list box of easyUI. Let's talk technology:

The first is the jsp interface:

The manager provided me with easyUI, and I used the datagrid demo above to make a blacklist interface:

code show as below:

<table id="dg" class="easyui-datagrid" title="驾校黑名单管理" style="width:100%;height:auto"
			data-options="
				iconCls: 'icon-edit',
				singleSelect: true,
				toolbar: '#tb',
				url: 'datagrid_data1.json',
				method: 'get',
				onClickRow: onClickRow
			">
			<div id="tb" style="height:auto">
		<span>手机号码:</span>
		<input id="itemid" style="line-height:18px;border:1px solid #ccc" placeholder="请输入">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" οnclick="getChanges()">查找</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-undo',plain:true" οnclick="reject()">重置</a>
		<a href="<%=basePath %>car/add" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" οnclick="accept()">添加</a>
		
	</div>

This is the generation process of the graphical interface (not all I have tested, only one input box can be generated)

Due to space limitations, I will not list them in detail. There is also a process of calling json number table by jsp and the interface written by jqury. There are too many, and I don't understand.

I glued it directly.

The second is for the controller to find the page layer:

code show as below:

public class BlackController extends BaseController
{
	
	
	

	@RequestMapping(value = "/list")		
	public String gotoweb(HttpServletRequest request)
	{
		List<Blacklist> data = this.blackService.getAllBlacklist(request);
		return "blackList2page";	
	}


Here you need to call the method getallblacklist in the service business logic layer, and establish a connection with the interface/List through annotations

The last part is the part I really think about: the service implementation class:

code show as below:

/**
	 * 获取黑名单
	 */
	public List<Blacklist> getAllBlacklist(HttpServletRequest request){
		List<Blacklist> dataList = this.baseDao.findAll(Blacklist.class);
		request.setAttribute("blackList", dataList);
		return dataList;
	}<pre class="java" name="code">/**
	 * 获取黑名单
	 */
	public List<Blacklist> getAllBlacklist(HttpServletRequest request){
		List<Blacklist> dataList = this.baseDao.findAll(Blacklist.class);
		request.setAttribute("blackList", dataList);
		return dataList;
	}

 
 

Sorry for the heavy post. "^...^"

The function I want to achieve is to read data from the database. The interface posted above shows it. Below is a set of data that I inserted into the database.

Check out the query results

I don't want to talk about any technology here, because many things are done with the help of other colleagues who are more experienced than me, and I am very grateful for their patient explanations

, I have been learning the things in this framework by myself a few days ago, and I feel that I have taken a lot of detours. This function is very simple. For me, who has not attended training courses

It is still very difficult to touch such a highly encapsulated frame at once. "? ...? "Now, I still don't understand the principle of it, I can only compare it with a gourd.

Not to mention, I will do other functions in the afternoon, I will post it and share it with you when I have time.





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324188146&siteId=291194637