-
Jun 26th, 2012, 01:49 AM
#1
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.
-
Jun 26th, 2012, 08:24 AM
#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";
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules