javax.servlet.jsp.JspTagException: Neither BindingResult nor plain target object for bean (蛋疼死我了)

1为抛出异常原因,2为异常解决方法。

 原因:   进入spring:bind标签源码你可以看到

Object target = requestContext.getModelObject(beanName);
   if (target == null) {
    throw new IllegalStateException("Neither BindingResult nor plain target object for bean name '" +
      beanName + "' available as request attribute");
   }

beanName=  <spring:bind path="command.spjg">的绿色部分

如果你是直接对某个页面进行请求,那么request中还没command这个对象

2.

在页面上加上

<jsp:useBean id="command"  class="com.ztenc.proj.bean.AFRFOAP" scope="request" ></jsp:useBean>

红色部分填上你的绑定类

原文地址:https://www.cnblogs.com/kyxyes/p/3612471.html