请误操作 2017-04-02 06:14 采纳率: 40%
浏览 2244
已采纳

SSM DispatcherServlet

控制台没报任何错,点击登陆就出现

 DispatcherServlet with name 'DispatcherServlet' processing POST request for [/Motorcontrol/user/login.action]
DEBUG [http-nio-8080-exec-1] - Looking up handler method for path /user/login.action
DEBUG [http-nio-8080-exec-1] - Returning handler method [public ynnu.zmf.entity.McResult ynnu.zmf.controller.UserController.login(java.lang.String,java.lang.String,java.lang.String)]
DEBUG [http-nio-8080-exec-1] - Returning cached instance of singleton bean 'userController'
DEBUG [http-nio-8080-exec-1] - Creating a new SqlSession
DEBUG [http-nio-8080-exec-1] - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3b3fe2a] was not registered for synchronization because synchronization is not active
DEBUG [http-nio-8080-exec-1] - Fetching JDBC Connection from DataSource
DEBUG [http-nio-8080-exec-1] - JDBC Connection [jdbc:mysql://localhost:3306/motorcontrol, UserName=root@, MySQL-AB JDBC Driver] will not be managed by Spring
DEBUG [http-nio-8080-exec-1] - ooo Using Connection [jdbc:mysql://localhost:3306/motorcontrol, UserName=root@, MySQL-AB JDBC Driver]
DEBUG [http-nio-8080-exec-1] - ==>  Preparing: select * from user_descript where UserName=? and Password=? 
DEBUG [http-nio-8080-exec-1] - ==> Parameters: 张三(String), 123456(String)
DEBUG [http-nio-8080-exec-1] - <==      Total: 1
DEBUG [http-nio-8080-exec-1] - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3b3fe2a]
DEBUG [http-nio-8080-exec-1] - Returning JDBC Connection to DataSource
 INFO [http-nio-8080-exec-1] - CHECK_ENCODING:9190
 INFO [http-nio-8080-exec-1] - client_code:9190
DEBUG [http-nio-8080-exec-1] - Rendering view [org.springframework.web.servlet.view.JstlView: name 'user/login'; URL [/jsp/user/login.jsp]] in DispatcherServlet with name 'DispatcherServlet'
DEBUG [http-nio-8080-exec-1] - Added model object 'mcResult' of type [ynnu.zmf.entity.McResult] to request in view with name 'user/login'
DEBUG [http-nio-8080-exec-1] - Added model object 'org.springframework.validation.BindingResult.mcResult' of type [org.springframework.validation.BeanPropertyBindingResult] to request in view with name 'user/login'
DEBUG [http-nio-8080-exec-1] - Forwarding to resource [/jsp/user/login.jsp] in InternalResourceView 'user/login'
DEBUG [http-nio-8080-exec-1] - Successfully completed request

SpringMVC配置
<!-- 可以扫描controller、service、...-->
    <context:component-scan base-package="ynnu.zmf.*"/>
    <mvc:annotation-driven/>
    <context:annotation-config />
    <import resource="applicationContext-dao.xml" />
    <import resource="applicationContext-transaction.xml"/>
    <bean
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <!-- 配置jsp路径的前缀 -->
        <property name="prefix" value="/jsp/"/>
        <!-- 配置jsp路径的后缀 -->
        <property name="suffix" value=".jsp"/>
    </bean>

  • 写回答

3条回答 默认 最新

  • 请误操作 2017-04-03 05:31
    关注

    问题已经解决,解决办法就是在controller层加上@responsebody

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题