File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Sneak in AJAX  inside a struts application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Sneak in AJAX  inside a struts application" Watch "Sneak in AJAX  inside a struts application" New topic
Author

Sneak in AJAX inside a struts application

Venkatraman Kandaswamy
Ranch Hand

Joined: Jul 07, 2004
Posts: 120
I am working on a pilot to use AJAX in our struts application. I make a javascript call to say fetchSSN.do - and it gets mapped to an action servlet - say FetchSSNAction. Now this action servlet has to return the SSN ( as a string ) to the place where I make the javascript call. But the action servlet will only return to the controller servlet.

So how do I do this - action servlet returning value to the javascript call. Even if I could - will the MVC puritans agree to this?

Thanks.
[ July 19, 2005: Message edited by: Venkatraman Kandaswamy ]

--Venkatraman<br />SCJP 1.4<br /><a href="http://kvrlogs.blogspot.com" target="_blank" rel="nofollow">blog</a>
Venkatraman Kandaswamy
Ranch Hand

Joined: Jul 07, 2004
Posts: 120
I found the solution. Its so simple. Just let the controller servlet forward to a JSP page which has these lines.


Thanks to
Frank W. Zammetti 's tutorial
 
wood burning stoves
 
subject: Sneak in AJAX inside a struts application