Neither BindingResult nor plain target object for bean name 'helpf' available as requ
HelpFaqController.java
@RequestMapping(value = "/searchallfaq", method = RequestMethod.POST)
public String searchFaq2(@ModelAttribute("helpf") HelpFaqModel helpfaqmodel,BindingResult bindingResult,
Model model,HttpServletRequest request) {
String abc=helpfaqmodel.getSearch();
model.addAttribute(new HelpFaqModel());
System.out.println("heyaaaaaaaa"+abc);
//model.addAttribute("serviceOffering", serviceOffering);
//model.addAttribute("list", helpFaqService.findAllServices());
return "help/faq/faqqna";
}
faqqna.jsp
<form:form method="POST" modelAttribute="helpf" action="/storefront-webapp/help/ces/faq/searchallfaq">
<form:input path="search"/>
<input type="submit" value="submit"/>
</form:form>
HelpFaqModel.java
package com.accenture.ces.storefront.presentation.controll er.help;
public class HelpFaqModel {
private String search;
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
}
I am getting Neither BindingResult nor plain target object for bean name the moment I write <form:input path="helpf"/>...plz anybody can solve this problem...
My problem is still not solved.Can you please look what wrong now?I cant find the err
Can you please look what wrong now?I cant find the error now?
Include a bindingresult in your controller ankur. I hope that might solve your problm
A method inside your controller that should listen for a post method Request Mapping with the request url and you should add the binding result into the page you are returning in you controller method.
For example,
@RequestMapping(method = RequestMethod.POST)
public String processForm(@Valid Login login, BindingResult result, Map<String, LoginForm> model) throws Exception
{
//do the validation and other form processing here
model.put("login",login);//add the model object into the login object
return loginsuccess;//show a success page
}
http://blog.nigelsim.org/2011/09/07/...bindingresult/
hope this helps...
Quote:
Originally Posted by
Ankur007
Can you please look what wrong now?I cant find the error now?