This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sneak in AJAX inside a struts application
 
Similar Threads
Struts action triggered by onUnload event on cloaing a browser
link css style sheet
autocomplete in struts 1.3
How do i use requestDispatcher.forward to forward to my struts action servlet?
ArrayList and Ajax