• Post Reply Bookmark Topic Watch Topic
  • New Topic

disable or enable menu item using servlet and jsp  RSS feed

 
maha hassine
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone ,i have a little problem , i would be thankfull if you can help me :
i have a jsp page which contains a menu bar , this page is the home page it means that it is visible for all the users . i want to make some menu items disabled and the others enabled based on the status of the user ( it can be simple user or administrator)
i m using jsp and servlet .
please suggest . thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are any number of conditional constructs in JSTL that you can use to make decisions. Look up <c:if> and <c:choose> to start.
 
maha hassine
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i fixed the import of the JSTL library
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, then you should be able to learn how to use the conditional actions to make decisions on how your pages are generated.

One thing: just because you hide something in the UI does not make it secure. You must always check operations on the server for proper authentication and authorization as well!
 
maha hassine
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i achieve this please?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Achieve what? We've talked about a few things. Your question is very vague; please be more explicit.

To skip an element is very simple:

If expression evaluates to false, the button is omitted.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!