Results 1 to 4 of 4

Thread: Neither BindingResult nor plain target object for bean name 'helpf' available as requ

Hybrid View

  1. #1
    Join Date
    Oct 2012
    Posts
    2

    Lightbulb 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...
    Last edited by Ankur007; Oct 29th, 2012 at 11:05 AM.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    Please use [ code][/code ] tags when posting code that way it remains readable.

    I also suggest the forum search as this question ahs been answered numerous times before, you also want to read the reference guide as that explains the naming conventions for beans added to the model.

    In short your modelAttribute is named helpFaqModel ...

    Also judging by your code the next issue you will run in will be the fact that there is no property named helpf as I see nothing of the sorts in your model object.

    Again I strongly suggest the reference guide or this book... (shameless plug )./
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Oct 2012
    Posts
    2

    Default 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?

  4. #4

    Question 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 View Post
    Can you please look what wrong now?I cant find the error now?

Posting Permissions

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