I am creating a web application on tomcat in framework struts2. I am using intercepters to maintain user session by saving user object in session. Intercepters work fine in order to check user object in session when there is call to action but there are some jsp as well in my application and these jsp can be called directly by url. In this case i want to redirect user to login page if there is no user object in session. Currently i am using sendRedirect method i jsp to redirect to login page. Could you please tell me if these is any better way of doing this?
Share
Yes; don’t directly access JSP pages. Doing so is counter to what’s appropriate in an MVC app.