Announcement Announcement Module
Collapse
No announcement yet.
Neither BindingResult nor plain target object for bean name 'helpf' available as requ Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 12:05 PM.

  • #2
    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 )./

    Comment


    • #3
      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?

      Comment


      • #4
        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...
        Originally posted by Ankur007 View Post
        Can you please look what wrong now?I cant find the error now?

        Comment

        Working...
        X