0

When I click submit in localhost:8080/myregister.jsp(controller: localhost:8080/user/register),it gets:

Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cn.hnust.dao.UserMapper.insert

When I click submit in localhost:8080/login.jsp,(controller: localhost:8080/user/login),it works.

[MYSQL:

DROP TABLE IF EXISTS user_t;
CREATE TABLE user_t (
username varchar(40) NOT NULL,
password varchar(255) NOT NULL,
PRIMARY KEY (username)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

]

I use mybatis-generator-core-1.3.2 to general UserMapper.xml,but why only the 'insert' function can't run?

The whole Maven project is in github:https://github.com/Bonsen/Spring-SpringMVC-mybatis.

Bonsen
  • 1
  • The exception should have line numbers, so that will tell you where it's trying to use the statement, and that should tell you what it isn't finding, that should get you at least part way to a solution. Also, edit your post to format the code like code (click the {} icon). – blm Jan 11 '16 at 02:40
  • Sorry,I'm careless.All codes are in github.When I run it and click the only 'submit' button of myregister.jsp on tomcat, the form of myregister.jsp will throw something wrong. – Bonsen Jan 11 '16 at 07:37
  • It said:"org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.cn.hnust.dao.UserMapper.insert ,at com.cn.hnust.service.impl.UserServiceImpl.insert(UserServiceImpl.java:30) at com.cn.hnust.controller.UserController.toIndex(UserController.java:39) – Bonsen Jan 11 '16 at 07:43
  • @blm ,UserServiceImpl.java:30 is:public int insert(User user) { this.usermapper.insert(user);//this!!!! return 0; },UserController.java:39 is: @RequestMapping(value = "/register",method = RequestMethod.POST) public String toIndex(@RequestParam(value="username") String username,@RequestParam(value="password") String password,Model model){............. user.setUsername(username);user.setPassword(password); this.userService.insert(user);//this!!!! model.addAttribute("user", user);}return SUCCESS; } – Bonsen Jan 11 '16 at 07:44

0 Answers0