File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use ajax with spring 3