File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to render a jsp through ajax in springmvc

 
Stevenson Anderson
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

I could not able to make a request through ajax in my jsp. Please do help me.
The code goes like below....

this is the ajax code in jsp page.


And the controller class is



The function doAjaxPost(id) is called and i can see the alert message, We are in doAjaxPost with id "+id .
But after that its getting failed to post the request (There are no messages in the console from showcolumnlist method of controller class).
But getting an error alert " Error : [object Object] "
I could able to make the request without ajax successfully.

Do help me....
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would not use the @ResponseBody on a ModelAndView personally. Are you seeing your sysout? Here is an example of ajax with an mvc controller.

https://github.com/SpringSource/spring-mvc-showcase/blob/master/src/main/webapp/WEB-INF/views/home.jsp

You can browse around that same project to see the controller side or just download the whole thing and import it as an existing maven project into STS. Get it here:
https://github.com/SpringSource/spring-mvc-showcase/downloads

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic