For example if admin logs in i need 2 tabs in header , and if a user logs in i need 1 tab. How to proceed with this? I have included and i want to know the javascript for this to work.
You don't need a java Script for this. you have to get a Database connectivity. Create a Table in a DB that have Admin name and user's name. when Login, if it's admin it will prompt to the page that will have 2 headers if not it will re-direct to the page that will have one header. You can achieve this by using response.sendRedirect()
function. in your JSP page
first of all, you have to provide logged user type like admin or user at login time . if logged user type is admin then pass url parameter like userType='ADMIN' or userType='USER'
and check in header.jsp page if userType='ADMIN'
load 2 tabs otherwise one tab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With