It's not a secret anymore!
The moose likes JSP and the fly likes disable the links in jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "disable the links in jsp page" Watch "disable the links in jsp page" New topic

disable the links in jsp page

smyle khanna
Ranch Hand

Joined: Jan 14, 2004
Posts: 54
i have 2 jsp is the login page n other main page which is displayed after the login page.this main page contains menu coded in javascript n dhtml.
the user are divided into several groups and depending on the type of the group of user ,certain menu links in the main page must be disabled.
how can i disable or prevent the user from access certain links in the menu for which he has no permission?
plz help me out
thanks in advance
C. P. Chouksey Raisen

Joined: Feb 20, 2004
Posts: 2
during creating UserID, u add any prefix or suffix string which show u an identity of a particular group. Store this user id into session when login, and on the click event of ur menu
u just check that substring (prefix or suffix string which u added during userID creation).
execute ur operation if this match with ur group, nothing otherwise.

CP Chouksey<br />Raisen (MP) India<br />Mobile- +91-98452-39250.
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
That or you could simply use standard J2EE constructs like HttpRequest.isUserInRole().


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
smyle khanna
Ranch Hand

Joined: Jan 14, 2004
Posts: 54
thanks a lot 4 the responses
the UserGroup id i have passed using a session...but i dont know how exactly to disable or restrict the user of the particular group from access the menu links....
i cant use seperate menu for each group since the number of groups are more,so in the main page according to the group rights the links must be enabled or disabled or provide sum alert or sumthing which prevents the user from accessing it.
,overall the user group not having rights must not b allowed to access tht menu links........
plz help me outta wuld b more helpful if i get guidelink
thanks in advance
I agree. Here's the link:
subject: disable the links in jsp page
It's not a secret anymore!