猿问

测试login.do,用户名不存在,传参没有成功?? 求大神帮忙解决下_慕课网实战【idea+tomcat+maven+ssm】

怎么解决下呀,从dao层都没有拿到数据??

测试login.do结果:

debug调试结果:

http://img.mukewang.com/59915f2300016a8107730422.jpg

http://img.mukewang.com/59915f240001286007440151.jpg

控制台打印输出:

http://img.mukewang.com/59915f2400019cb808150642.jpg

14-Aug-2017 15:43:49.005 警告 [http-nio-8080-exec-10] org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver.handleHttpRequestMethodNotSupported Request method 'GET' not supported

[15:44:48.815][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8080-exec-4] Creating a new SqlSession

[15:44:48.851][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8080-exec-4] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@34463302] was not registered for synchronization because synchronization is not active

[15:44:51.497][DEBUG][o.m.s.t.SpringManagedTransaction][http-nio-8080-exec-4] JDBC Connection [jdbc:mysql://localhost:3306/mmall?characterEncoding=utf-8, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring

[15:44:51.512][DEBUG][com.test.dao.UserMapper.checkUsername][http-nio-8080-exec-4] ==>  Preparing: SELECT COUNT(1) FROM mmall_user WHERE username = ?

[15:44:51.551][DEBUG][com.test.dao.UserMapper.checkUsername][http-nio-8080-exec-4] ==> Parameters: null

[15:44:51.708][DEBUG][com.test.dao.UserMapper.checkUsername][http-nio-8080-exec-4] <==      Total: 1

[15:44:51.715][DEBUG][org.mybatis.spring.SqlSessionUtils][http-nio-8080-exec-4] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@34463302]

------ServiceImpl返回username=---------null

------Controller返回username=---------null


筱爻
浏览 3298回答 2
2回答

大咪

虽然我没有看过这个实战课,但是可以提供你个检查的思路,先从前端入手,前端用alert拿下你穿的值看看前端有没有获取到,如果获取到了,再到对应的Controller层打印一下从前端接收的用户名和密码,看看是不是为空

慕UI937661

请问题主解决了吗?
随时随地看视频慕课网APP
我要回答