jackwade 2017-01-02 06:00 采纳率: 16.7%
浏览 5615
已结题

springBoot+thymeleaf访问时报错!!!!

图片说明

@RequestMapping("/")
public String index(){
        return "/helloThymeleaf";
}

@RequestMapping(value="/findDept",method=RequestMethod.POST)
public String findDept(Dept dept,Model model){
    System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!");
    Dept dept1 = deptDao.findByDeptNo(dept.getDeptNo());
    model.addAttribute("deptList",dept1);
    return "/helloThymeleaf";
}

输入localhost:8080后报错

报错信息

java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'Dept' available as request attribute
at org.springframework.web.servlet.support.BindStatus.(BindStatus.java:144) ~[spring-webmvc-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.thymeleaf.spring4.util.FieldUtils.getBindStatusFromParsedExpression(FieldUtils.java:401) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.spring4.util.FieldUtils.getBindStatus(FieldUtils.java:328) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.spring4.util.FieldUtils.getBindStatus(FieldUtils.java:294) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.spring4.processor.attr.AbstractSpringFieldAttrProcessor.processAttribute(AbstractSpringFieldAttrProcessor.java:98) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.processor.attr.AbstractAttrProcessor.doProcess(AbstractAttrProcessor.java:87) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.processor.AbstractProcessor.process(AbstractProcessor.java:212) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.dom.Node.applyNextProcessor(Node.java:1017) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.thymeleaf.dom.Node.processNode(Node.java:972) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]

  • 写回答

6条回答 默认 最新

  • jackwade 2017-01-02 05:58
    关注

    页面

    名称
    评论

报告相同问题?

悬赏问题

  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法