I checked this question, and I know how to get and check user role in java.
But, what I want is, when user clicks some links in page, if user has no right on that, how can I get it and return some message like "no rights" in a message fields? Currently, there will be an exception.
I didn't use spring tags in page, I know the tags that display this link if only user has some role. But I don't want to user those tags for some reasons.