• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use ajax with spring 3

 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to use ajax with spring 3 but i can't find a correct tuto so i post here some questions.
here is my function js


here is my controller where i want to get my object Menu:

How can i get my param id from my js function getDetails?
i receive an alert error from my function getDetails: Error occured
How can i get my object in my function js to display the result? for example :
document.getElementById('txtDesc').value = object.getDesc()

thanks for your help
 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added this 2 jar:
jackson-core-asl-1.9.9.jar
jackson-mapper-asl-1.9.9.jar

modify my spring-context.xml:

i modify the servlet to return my object:


and finally my js function that return the alert error!


the error say: La ressource demandée (/starterSpring/WEB-INF/jsp/admin/getDetails.jsp) n'est pas disponible.
it's correct but how can i tell it thats the same page : admin/gestionMenu.jsp
thansk for your help
 
fabian verbeek
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it works i forgot : @ResponseBody
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic