I have header.jsp, whose style constantly changes its dynamic header for different logins

For example, if the administrator log contains 2 tabs in the header, and if the user logs in, I need 1 tab. How to do it? I have included and I want to know how javascript works.

+6
source share
2 answers

You do not need java Script for this. you need to connect to the database. Create a table in the database with the administrator name and username. when Login, if he is an administrator, he will offer a page that will have 2 headings, if not redirected to a page with one heading. You can achieve this using the response.sendRedirect() function. on the JSP page

+2
source

First of all, you must specify the registered user type, for example, admin or user at login time. if the registered user type is admin, then pass the url parameter, for example userType='ADMIN' or userType='USER' , and check the header.jsp page, if userType='ADMIN' load 2 tabs, otherwise one tab.

+1
source

Source: https://habr.com/ru/post/971521/


All Articles