permaculture playing cards
The moose likes Struts and the fly likes Suggest a Solution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Suggest a Solution" Watch "Suggest a Solution" New topic

Suggest a Solution

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi all,
i had a requirement and since i am new to Struts i doubt whether it is possible using Struts Framework.

I had a simple java bean which has a student information. there can be 'n' of instances for n number of students. i am displaying these information to the user in front end by having a array containing all the student objects. User had a option to choose any students he wish and submit it for some other process (done in another target action servlet).

The problem here is how can i determine which students did the user selects in the target action servlet..

Currently i acheived this by having a hidden html variable that holds the list of students the user seleceted. set that varible in request attribute.
Refer this variable in the action servlet and process only the chosen students.

But i felt there might be some better way to do this type of requirement using struts (ActionForm bean) .

Any idea how to acheive thiss???

Hope u understand my requirement.....
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In Struts you would accomplish this in essentially the same manner as you are doing now, except that you would define the variable with the list of students in your ActionForm and refer to it rather than getting it from the request object.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Suggest a Solution
It's not a secret anymore!