云笔记模块ajax和后台交互的流程是什么

客户端代码:
if(ok){
$.ajax({
url:"http://localhost:8080/note/user/login.do",
type:"post",
data:{"name":name,
"password":password},
dataType:"json",
success:function(result){
if(result.status==0){
//获取登录者ID
var userId = result.data;
//将登陆者ID放入Cookie
addCookie("userId",userId,2);
window.location.href="edit.html";//成功
服务端代码:
usermapper。xml代码
parameterType="string"
resultType="org.tarena.note.entity.User">
select * from cn_user
service代码:
private UserMapperDao userDao;//注入

public NoteResult checkLogin(
    String name, String password) {
    NoteResult result = new NoteResult();
    User user = 
        userDao.findByName(name);
    if(user == null){
        result.setStatus(1);
        result.setMsg("用户名不存在");
        return result;
    }

             findbyname获取的是客户端传过来的用户名还是数据库中的名字
            客户端传过来的用户名怎么和数据库中的用户名比对的

            谢谢大神们解答

传过来的,你需要通过查询数据库进行比对。

select * from user where username="前台传过来的name"

findByName是根据你客户端传递过来的用户名进行查找,之后返回实体。如果实体为null,则说明没有匹配项,即该用户名不存在。实体不为空的情况下再核对密码