My question is how to dynamically create menu bar from the database according to user credential using JSF 2.0 ? kindly provide me some hints or links which can be of help. Thanks
Asked
Active
Viewed 2,265 times
0
-
There's plenty of help on this topic. Try reading this [post](http://stackoverflow.com/questions/4747321/render-jsf-component-based-on-user-role). User roles are your friends in this case. – Kuba Nov 08 '13 at 11:38
-
Simply using the `rendered` attribute with one bean managing the user roles? – Alexandre Lavoie Nov 08 '13 at 11:41
-
1@awesum, have you tried something? – Aritz Nov 08 '13 at 11:42
-
@Alexandre Lavoie How to do it? I have three tables in database 1)Menu 2)Users 3)menu_users – awesum Nov 11 '13 at 05:38
1 Answers
1
Have you considered using Third party component libraries with JSF.
You could go for Primefaces.
It has a different varieties of Menu Bars here.
Here using p:menu
, you can create menu using Menumodel. that model can be changed from ManagedBean based on the user Privileges.
Here is the Primefaces Menu Model Example,where last Programmatic Menu is created using MenuModel.
Here is the Primefaces Blog Link.

Kishor Prakash
- 8,011
- 12
- 61
- 92
-
By dynamic menu , I mean a particular user should be shown some menu items or in other words he can navigate to some of the pages using menu bar – awesum Nov 08 '13 at 11:26
-
1
-
See the left correct symbol on the answer? @awesum click that. Accepting answer which helped you, will increase your reputation, too. You have 0% acceptance ratio, so improve it :) – MysticMagicϡ Sep 02 '14 at 05:43