We help IT Professionals succeed at work.
Get Started

Struts and dynamic controls/control array

appari
appari asked
on
3,520 Views
Last Modified: 2011-10-03
I am new to struts framework.

the working environment is windows + IIS + Tomcat 5 + Struts 1.1

the problem is i need to develop a jsp page using struts framework and the view is something like this

|----------------------------------------------------------------------------------|
|        ID        |                     |      Name       |          Qty    |    Stock     |
|----------------------------------------------------------------------------------|
| TextBox       |       Button     |   TextBox       |   TextBox     |  TextBox   |
|----------------------------------------------------------------------------------|
|TextBox       |       Button     |   TextBox       |   TextBox     |  TextBox   |
|----------------------------------------------------------------------------------|
|TextBox       |       Button     |   TextBox       |   TextBox     |  TextBox   |
|----------------------------------------------------------------------------------|
|TextBox       |       Button     |   TextBox       |   TextBox     |  TextBox   |
|----------------------------------------------------------------------------------|
|TextBox       |       Button     |   TextBox       |   TextBox     |  TextBox   |
|----------------------------------------------------------------------------------|

"TextBox" means HTML Text box is displayed same with button.
in asp/jsp i can name the controls dynamically and use request.getparameter("controlName") to get the value.

but how do i do the same thing using struts frame work? here in the above sample i displayed only 4 rows but in actual case it can be 10/20. is there any way achieving this? i am a newbie to using Struts, please give me step by step example on creating actionform and actionclass.
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2004
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE