Results 1 to 2 of 2

Thread: SimpleFormController with ajax

  1. #1

    Default SimpleFormController with ajax

    Hi guys..

    I am working on a spring mvc project. I have a simple jsp page showing drop down lists of departments and operations to be performed. After selecting department and operation (update,delete,view) i want to get the form from simpleformcontroller using ajax. But i am unable to display simpleformcontrollers response on current
    page.

    Could anyone suggest me the perfect solution for this..


    Thanks in advance.

  2. #2
    Join Date
    Oct 2011
    Posts
    7

    Default

    Using annotations you can do like this
    @Controller
    public class MyController {

    /*For the jsp page request via ajax

    */
    @RequestMapping("/myPage")
    public ModelAndView getSomePage() {

    return new ModelAndView("myPage"); //ur jsp page
    }

    /*For the data request via ajax

    */
    @RequestMapping(value = "/getData")
    @ResponseBody
    public String handleSaveMyData(HttpServletRequest request,HttpServletResponse response){


    return "data";
    }

    }

Posting Permissions

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