You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by jonathan zhang <lo...@gmail.com> on 2005/02/22 03:26:20 UTC
efficient building of menu item in jsp
Hi folks,
I wish to construst a menu in jsp, and the menu has the following
characteristics:
1.it has a two level hierarchy,
Paren1->child1
->child2
paren2->child3
->child4...
2. some of the menu items might change/appear/not shown on different
parent jsp pages.
I wish to construct the menu as java code imbedded in the jsp page,eg.
String[]menuParent={parent1,parent2,...};
String[][]menuChildren={{child1,child2},{child3,child4}};
and then get a Vector pagesShown from a bean that stores what pages to
show based on several factors.
and then loop through the menuParent and menuChildren to print them to the page.
Is this a good approach? any advise on alternative approaches or
improvements on this approach?
any more efficient methods?
thanks!!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: efficient building of menu item in jsp
Posted by Tim Christopher <ti...@gmail.com>.
FYI
*****
For a JavaScript menu try: http://struts-menu.sourceforge.net/
For an HTML/CSS approach (not designed for struts) try :
http://www.htmldog.com/articles/suckerfish/dropdowns/
The first link is probably the obvious choice for a Struts application
however as it stores the menu names within the JavaScript, ie.
oCMenu.makeMenu('ToDoListMenuFile','','File'+cmTopMenuImage+....), it
does not work with screen readers etc.
The HTML/CSS approach lets you just define the menu as an unordered
list, however you have to devise your own method for only displaying
the correct ones - ie. req:isUserInRole etc. and make sure your CSS
knowledge is up-to-date.
Tim Christopher
On Mon, 21 Feb 2005 18:26:20 -0800, jonathan zhang <lo...@gmail.com> wrote:
> Hi folks,
> I wish to construst a menu in jsp, and the menu has the following
> characteristics:
> 1.it has a two level hierarchy,
> Paren1->child1
> ->child2
> paren2->child3
> ->child4...
> 2. some of the menu items might change/appear/not shown on different
> parent jsp pages.
> I wish to construct the menu as java code imbedded in the jsp page,eg.
> String[]menuParent={parent1,parent2,...};
> String[][]menuChildren={{child1,child2},{child3,child4}};
> and then get a Vector pagesShown from a bean that stores what pages to
> show based on several factors.
> and then loop through the menuParent and menuChildren to print them to the page.
> Is this a good approach? any advise on alternative approaches or
> improvements on this approach?
> any more efficient methods?
>
> thanks!!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org