I can not get this working and I dont know why...
- Inside my .jsp I want to check if the executing user has suffient rights to do so.
- the user object from the class user is one of the session attributes
- inside my .jsp file I get the Object from the session
- I then cast it into user
then I can access its stored values (which is an array list)
Then when I go and test my code I get the error listed below.
Any Idea how to solve this Problem??
user_management.jsp
<%
User user = (User) session.getAttribute("obj_user");
boolean test = user.oe_fac_role_right.get(2).get(0).equals(1);
if (test) {
%>
- some html code will be displayed here is the user is allowed to see it
<% } %>
User class
public class User {
int user_id;
String username;
List<List<Integer>> oe_fac_role_right = new ArrayList<List<Integer>>(4);
public User(){}
....
....
}
Creation of User Object in login class:
User user = new User(user_id, username, user_rights);
Passing User Object to session:
session.setAttribute("obj_user", user);
Error message from Netbeans
An error occurred at line: 14 in the jsp file: /user_management.jsp
user cannot be resolved to a type
Line 14 in this case is: User user = (User) session.getAttribute("obj_user");