I am having difficulty with authentication of user levels.
I have to kinds of users "user" and "administrators".
What we did in mySQL db is make a user table and in it, a "level" column is
placed containing whether a user is "administrator" or not.
there's no problem with this actually (I just wrote the situation and
setup).
*Now, I want the server to send a 403 response to non-administrative
personnel accessing some secured places in our site.*
How can I do this?(Or is this possible? I have no idea actually..)
I have a userBean.java that contains all user informations from database.
I made this in my execute method in Action class. (Something Like this)
execute(response, request, form....){
UserActionForm uaf = (UserActionForm) form;
UserBean userbean = new UserBean();
* if (userbean.getlevel().equals("user")){
response.sendError(SC_FORBIDDEN);
}
* return mapping.findForward....("Sucess");
}
this code does not compile..sendError() expects int value. I tried
sendError(403) but doesn't work.
Any Help is Gladly Appreciated! =)
God Bless!
Ryan Webb from Philippines