Results 1 to 2 of 2

Thread: Neither BindingResult nor plain target object for bean name 'loginInfo' available

  1. #1
    Join Date
    Oct 2011
    Posts
    17

    Unhappy Neither BindingResult nor plain target object for bean name 'loginInfo' available

    Dear all,
    Could someone please explain this error to me in my code. I am using SimpleFormController like this. But I am getting the following error. Any help would be highly appreciated. Thanks a lot.

    "Neither BindingResult nor plain target object for bean name 'loginInfo' available as request attribute"
    Model Class is: LoginInfo

    #code: Controller:
    protected ModelAndView onSubmit(HttpServletRequest request,
    HttpServletResponse response, Object o,BindException errors)
    {
    LoginInfo loginInf = new LoginInfo();
    loginInf.setUserID("error");
    mv = new ModelAndView("loginForm");
    mv.addObject("Error", loginInf);
    return mv;
    }

    jsp: snippet.

    <form:form commandName="loginInfo" method="POST" action="login.html">
    <div><% LoginInfo error = (LoginInfo)request.getAttribute("Error");
    System.out.println(error);
    if(error != null){
    %> User ID or Password is Incorrect.
    <%}%>
    </div>

    #spring-xml file:
    <bean id="loginController"
    class="com.controller.LoginController">
    <property name="loginServiceBO" ref="loginServiceBO" />
    <property name="formView" value="loginForm"/>
    <property name="successView" value="itemDisplay"/>
    <property name="commandName" value="loginInfo"/>
    <property name="commandClass" value="com.LoginInfo"/>

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    Hello Kumar

    1) use code tags, it is more readable for us
    2) This error has been covered a lot of times in the forum years ago, do a search in the forum
    3) it is old, proceed to move to @Controller

    Let me know your advace
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •