I want to check if the (session) user has logged in so if a user tried to reach a resource (a link) and he's not connected he must be redirected to login page, I could this verification
//when logging in
sessionMap.put("logined",true);
then
public String checkLogin() {
//when trying to reach a resource
if ((Boolean) sessionMap.get("logined")) return "Logined";
else return "notLogined";
}
but I must execute this method in every method-action in class action
and I must treat the result in every action on struts.xml
.
so, my question is if there is a "light" solution using SessionAware
and sessionMap
:
private SessionMap<String,Object> sessionMap;
I rather not using Spring Security.