Im using struts 1.3 + spring 2.5 + hibernate 3.
我使用struts 1.3 + spring 2.5 + hibernate 3。
I have 2 table Category and Product.
我有2个表类别和产品。
---------CATEGORY---------
- cat_id(varchar)
- cat_name(varchar)
---------PRODUCT---------
- pro_id(int)
- cat_id(varchar)
- pro_name(varchar)
I load name of category from database as menu at top site using tags-logic
我使用tags-logic从顶部站点的数据库中加载类别名称
<logic:iterate id="cat" name="catList">
<bean:define id="ID" name="cat" property="catId" />
<a href="/ListProduct.do?catId=<%=ID %>">
<bean:write name="cat" property="catName" />
</a> |
</logic:iterate>
Its will be display like this:
它将显示如下:
CAT1 | CAT2 | CAT3 | CAT4 |
I want when I click on CAT1 or CAT2..., its will be show product name of that category at below the menu. How can I do that?
我想点击CAT1或CAT2 ...时,它会在菜单下方显示该类别的产品名称。我怎样才能做到这一点?
2 个解决方案
#1
0
When you click menu link it will submit to action class and get the product details and forward to same page with product list. Use same iterator and bean:write tag to display in the same page.
当您单击菜单链接时,它将提交到操作类并获取产品详细信息并转发到带有产品列表的同一页面。使用相同的迭代器和bean:write标记显示在同一页面中。
Does it answer your question ?
它能回答你的问题吗?
Let me know if you need any more help.
如果您需要更多帮助,请与我们联系。
#2
#1
0
When you click menu link it will submit to action class and get the product details and forward to same page with product list. Use same iterator and bean:write tag to display in the same page.
当您单击菜单链接时,它将提交到操作类并获取产品详细信息并转发到带有产品列表的同一页面。使用相同的迭代器和bean:write标记显示在同一页面中。
Does it answer your question ?
它能回答你的问题吗?
Let me know if you need any more help.
如果您需要更多帮助,请与我们联系。