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 Ajax and Struts 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 "Ajax and Struts" Watch "Ajax and Struts" New topic

Ajax and Struts

Kier Heyl

Joined: Sep 08, 2005
Posts: 1
I'm implementing autofill data by zip codes for a website. They're currently using struts, and it would be nice to tie AJAX into this so that I can auto fill out city and state based on the zip code they entered. There are between 20 and 30 different pages where this will be necisary. I'm still relatively new to struts, but what I'm wondering is am I going to have to create a seperate action mapping for each one of these pages? Or is there a way I can do one action mapping for all of them?
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
struts 2.0, code name 'shale' under development, is working on supports for AJAX. struts/tiles/included struts taglibs generate purely HTML in the end (unless you do client-side validation) so there is no AJAX support. however, auto-population of values dynamically on the client-side can be easily incorporated into struts using the standard javascript calls within form elements' attributes (onchange, onlick, etc.)

-/a<br />certified slacker...yes, my last name is 'do' - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Ajax and Struts
Similar Threads
AJAX and Struts
Best way to begin with struts?
How to integrate AJAX with Struts in a large Application
Struts Action and Java Servlet
question about validator framework