java - Roles in JSP and Servlet -
I want to create an application with three types of user: admin, professional and ordinary users will see all the special pages, so Should I use roles for a good example or tutorial of a person how to do it? Create a DataStore firstly the users and the roles and relationships between them. The simplest option would be a SQL database with a user
, role
and user_roles
tables.
Then there are basically two ways to achieve this in the JSP / servlet side.
-
The easiest to get started, but it will end up for long lasting maintenance. You must use the login subletter to create an HTML / JSP login form, a login sublett, login the user and login so that it can check if the user is logged in or / or access to requested resources. . Use
-
You just have to create an HTML / JSP login form and for the rest it goes to all the
web.xml
and server scope seminars is.
Specific page content / components based on the user's role to display, you can use JSTL's flow control tag: & lt; C: if & gt;
and & lt; C: select & gt;
.
Comments
Post a Comment