Announcement Announcement Module
Collapse
No announcement yet.
SimpleFormController with ajax Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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";
    }

    }

    Comment

    Working...
    X