Hi, I am displaying a list of items on a JSP page using Struts. I want to be able to select an item from the list to display more information about the item in another page. To display the items details on the second page I need to know what the ITEM_NUMBER is so that I can retieve the Item details in the Action Form and pass the data to the new JSP page. What is the best method to achieve this whist preserving the Struts MVC architecture. Below is an example of the first JSP page displaying a list of Items ready for selection:
This code just converts everything into dumb html. Moreover, since your bean has a number of itemrows so you can't directly identify which element ws selected by user. Which in turn means that you can't get your value(ITEM_NUMBER) directly form <bean:write ...../>
You should enclose your code in a <html:form/> tag and pass the ITEM_NUMBER property as a html input to the actionform.
Else, you can associate a <html:hidden/> element uniquely for every "listitemsRow" object and pass that to your action.
What I mean is
Hope this helps. [ March 07, 2008: Message edited by: Anubhav Anand ]