• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

enabling side menu based on user role in JSP?

 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create a application that has two types of users say Admin,user based on their role i have to show the side menu items in the application. anyone give me some idea how it will be done..?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the <c:if> and <c:choose>JSTL tags to make decisions.
 
manni ma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way is to have an XML file containing role information. Onload of a page you can write javascript function to parse an XML file and create menus at runtime.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
manni ma wrote:One way is to have an XML file containing role information. Onload of a page you can write javascript function to parse an XML file and create menus at runtime.

Umm, no. Bad idea. JavaScript can be disabled or spoofed easily. This is the sort of thing that needs to be done on the server.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As bear suggested, authorization should be done on server side.
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then i have to create two side menu's and if login member is admin display one thing and if he is user display another
like


is there any other solution....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's wrong with that one?
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to create two header pages and two side menu pages....so..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic