I'm trying to learn
struts and I have created a small application that deals and shuffles
cards to players. That part is working excellent...but now I want to display it and in my
JSP page I have the following code - which does work...I just know there has to be a better way - but I'm stuck on ideas!
I have the following code in my JSP page:
This does exactly what I want it to do - it iterates through my playerName arrayList and then iterates through the array list that contains all the
cards the player has in their hand.
This works just fine - if I know the player names. It just seems like this isn't the best solution. I would think that there would be a way to make this
alot more dynamic. And not have to use the <logic:equal> tags to determine which arrayList to display.
I was reading about logic:iterate and saw that there is an indexID - but I'm not sure if this is something I could even use. Can you do IF statements in the JSP page? Like if this is the first iteration of the player name - then display playerOneHand ArrayList, if this is the second iteration - then display playerTwoHand ArrayList, etc?
Anyone have any thoughts on what I can do to improve this?