wood burning stoves*
The moose likes Spring and the fly likes use ajax with spring 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "use ajax with spring 3" Watch "use ajax with spring 3" New topic
Author

use ajax with spring 3

fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
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

Joined: Oct 20, 2012
Posts: 52
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

Joined: Oct 20, 2012
Posts: 52
it works i forgot : @ResponseBody
 
Don't get me started about those stupid light bulbs.
 
subject: use ajax with spring 3
 
Similar Threads
Displaying a Greeting message using Ajax
Return multiple string in ajax response and use it.
Getting data from database using ajax
is it possible to use jquery post in Struts2
Alert data returned by Ajax