Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ajax and Struts

 
Kier Heyl
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic