Two Laptop Bag
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
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>
jQuery in Action, 3rd edition
subject: Ajax and Struts
It's not a secret anymore!