My application is using struts 1 and the pages are role-protected (i.e.: a user cannot access a page if his role doesn't allow him) using the attribute "roles" of the action path in the struts-config.xml:
<action path="/ProtectedPageAction" type="org.apache.struts.actions.ForwardAction"
parameter="ProtectedPage" roles="admin" />
this way, if a user is either not logged in or doesn't have the role "admin", he sees the homepage instead of the protected page.
Now, all of this works perfectly, the only problem being that the URL in the browser (hence the value of servlet_path) is not "homepage.do" but "ProtectedPageAction.do" or, in other words, the servlet_path is not "in sync" with the shown page.
I need to work with the value of servlet_path hence when the user is not authorised to see a page, the url shown in the browser must be "homepage.do" and not "ProtectedPageAction.do"; this is also for security reason: if a user notices "ProtectedPageAction.do" in the URL might start wondering what's that for and how to access it etc.