Hi, I ask for help from anyone who can give it to me regarding a problem that I have not been able to solve for days.
I am creating a website with JSP + STRUTS1 technology that relies on a Tomcat 9.0.33 server and in the middle there is an Apache web server that acts as a proxy.
As a programming editor I use Eclipse. IT IS SPECIFIC THAT SO GIVING THAT THE ERROR I HAVE WHEN I START THE PROJECT WITHIN ECLIPSE IT DOES NOT MATTER THAT THERE IS APACHE IN THE MIDDLE BECAUSE ECLIPSE LAUNCHES ME LOCALHOST: 8080 / SITE NAME SO IT DOES NOT GO FROM APACHE UNTIL I TEST IN ECLIPSE
The problem is this:
I login from a home.jsp page through a form whose submit has been overwritten in jquery which makes an ajax call which calls a Login action of struts, in that action I put the user in session. At the end the call the ajax does window.location.replace (urlSite + "/"), that is relaunch the home of the site and I am still in home.jsp which however no longer shows the login form but a welcome note as it detects in session the user.
I state one thing to understand: a user can also be an admin and vice versa. In this site, if a user decides to become a recipe inserter, then a record is also inserted in the admin table with some user data and therefore we will have both a user and an admin connected to each other by a user_idUser field in the Admin table and admin_idAdmin in the table User. While browsing the site, if you enter some areas, the actions will remove the user in session to put his corresponding admin in session and when you exit these areas, the admin will remove himself from the session to put his corresponding user in session. These in-session objects are the UserBean classes (which contains an idAdmin property indicating its corresponding record in the Admin table) and AdminBean (which contains a UserBean object representing its corresponding user)
So far so good but the problem is a link always nalla home.jsp.
If I click on this link an action is called that removes the user from the session and puts me in session an admin corresponding to the user I have removed. The link is this:
the logoutUser = true "attribute makes it clear to the Recipe action that it must remove the user from the session and put his admin in session.
Even so far so good because in the Recipe action in debug in Eclipse I see that it removes the userBean and in