What's the best approach to populate a select box dynamically?

 

Imagine I need select boxes for the following fields (vehicle):

Make

Model

Year

 

Each of them are linked. If I select Make model should refresh and so
for model and year.

 

I was thinking about using <s:action/> tag  to render the output but
I've heard that's not recommended.

 

Also I've heard that you should implement it in the prepare() method of
the Preparable interface but I have my doubts because what if I need to
use those select boxes across different jsp pages, should I repeat the
same logic through all those prepare() methods of their respective
Actions?

 

Another approach would be to use javascript and get the values through
AJAX.

 

Or should I use JSP custom tags?

 

What do you think? What do you suggest?

 

Alfredo Osorio

Reply via email to