Hi All,
I am stuck with a very peculiar problem in
STRUTS...
I am making a web application where the menu's are generated dynamically by loading them from database.
I have a menu table, from where I get the menu id, menu name, menu level and parent menu flag.
Menu ID is primary key (DB2 TIMESTAMP), Menu name is name of menu, menu level describes what level should the menu be displayed at. For ex: if menu level = 0, it is a top level menu. It can have its children menu with menu level = 1.
Similarly menu level 1 can have children with menu level = 2
I need to display these in order:
first the top level menu (menu level = 0)
below it its children(menu level = 1)
second level menu(menu level = 2)
another top level menu (menu level = 0)
1st level children (menu level = 1)
..... and so on ...
I am getting the list of menu's, sorted in the order they have to be displayed in a vector with the four fields as menu id, menu name, menu level & parent menu flag. Parent menu flag is to indicate weather this menu has got children or not, so that I could know that I have reached the end of a tree and have no children menu's further.
I have to iterate through this vector in my
jsp page and display the menus in indented format based on their level..
Ex: Top Level Menu 1
First Level 1
First Level 2
Second Level 1
Top Level Menu 2
First Level 1
Second Level 1
.... and so on...
I have to put tabs based on the menu level, for 0 level no tab, for 1 level 1 tab, for 2 level 2 tabs .. and so on..
I need some solution as to how can I achieve this using STRUTS ....
Eagerly waiting for suggestions,
Thanks in Advance...
Yogesh