Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Neither BindingResult nor plain target object for bean name 'loginForm' available as request

Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Please somebody help on this issue. I have tried all the combination which are suggest on help sites to over come the issue, but i am unable to get rid of the error.

org.springframework.web.servlet.tags.form.InputTag | Neither BindingResult nor plain target object for bean name 'loginForm' available as request attribute
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'loginForm' available as request attribute
at<init>( ~[spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus( ~[spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]

Bean Class:

@Table(name = "LOGIN")
public class UserVO{

// = null;
public UserVO(){


@Column(name = "USER_ID")
private String userId;

@Column(name = "USERNAME")
private String username;

@Column(name = "PASSWORD")
private String password;

@Column(name = "CREATED_BY")
private String creadtedBy;

// Reference to other associated class
// Getter Setter


Controller Class:

public class HomeController{

@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView showLoginForm(@ModelAttribute("loginForm") UserVO loginForm, BindingResult result){
return new ModelAndView("login", "loginForm", new UserVO());

@RequestMapping(value = "/login", method = RequestMethod.POST)
public ModelAndView processForm(ModelMap model, @Valid @ModelAttribute("loginForm") UserVO loginForm, BindingResult result, HttpSession session){
ModelAndView view = new ModelAndView();

// Validation Code End.
view.addObject("loginForm", loginForm);
view.addObject("result", result);
// some good businee ,ogic

return view;



<section class="col_12 column">
<div class="col_12">
<div class="left">
<p id="title">Hello This is Validation Page</p>
<div class="col_12 horizontal">
<form:form action="login.html" method="post" commandName="loginForm">
<div class="inputItem">
<label for="login_userid"><spring:message
code="login.userid" /></label>
<form:input path="userId"
title="Please provide your User Id"/>
<form:errors path="userId" cssClass="error" />

<div class="inputItem">
<label for="login_password"><spring:message
code="login.password" /></label>
<form:password path="password" title="Password is required" />
<form:errors path="password" cssClass="error" />
<input class="button" type="submit"/>

Spring Configuration xml

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:mvc="" xmlns:xsi="" xmlns:tx=""
xmlns:beans="" xmlns:context="" xmlns:aop=""

<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven />



<!-- Hibernate Validator Start -->

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic