Java EE (struts/hibernate): Want to change main menu based on login, should use sitemesh in this case or is there any other option?

StackOverflow https://stackoverflow.com/questions/12084573

  •  27-06-2021
  •  | 
  •  

Question

I am making an application based on struts and hibernate , where based on user logins I have categorized different home screens for different users.

i.e.

Doctor logs in : DoctorHomePage.jsp

Nurse logs in : NurseHomePage.jsp

.

.

.

But I want to avoid this and make a single Home page and load various main menus and extruders , based on login credentials. Should I use sitemesh for this or is there a better solution then this. Just heard about sitemesh.

Thanks in advance.

Was it helpful?

Solution

I will suggest you to use Spring security for such use-case.Based on the logged in user, you can assign different role to the user like Doctor or Nurse and can show the menu items as per the user role.

This will help you much in future enhancement and its easy to add more roles in future and Spring security can easily handle all of this for you.

Alternatively you can keep your existing work approach to make pages based on the user role and included them based on the person who has logged in and what role/permissions logged in user have.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top