• Post Reply Bookmark Topic Watch Topic
  • New Topic

Use a variable instead of "admin" in <% if (request.isUserInRole("admin")) { %>  RSS feed

 
mark reusen
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hola,

I have code the following:
<% if (request.isUserInRole("admin")) { %>

But I want to use a session attribute instead of "admin".
Is this possible in a JSP page?
EL is also fine.

regards,
Mark
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may try the following.

NOTE: SA_ROLE session attribute may contain the word "admin".
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66152
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avoid scriptlets. If you know the JSTL and El, that's what you should be using. If not, time to learn.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!