Hi,
I'm quite a newbie in Struts and I have a question:
I have a login.jsp page with LoginForm and LoginAction classe associated with it. The user enters his login and password and if they are matching, the "user" bean is stocked to the session and the user is redirected to the main.jsp page.
My question is what is the best way to check in the main.jsp file that the visitor of this page logged in ?
I know I could write somethig like:
<%
if(session.getAttribute("user")==null){
response.sendRedirect("login.jsp");
}
%>
But I am looking for a "struts solution" : i want to have as little as possible code in my jsp pages.
Thanks for your help.
Tex.
I'm quite a newbie in Struts and I have a question:
I have a login.jsp page with LoginForm and LoginAction classe associated with it. The user enters his login and password and if they are matching, the "user" bean is stocked to the session and the user is redirected to the main.jsp page.
My question is what is the best way to check in the main.jsp file that the visitor of this page logged in ?
I know I could write somethig like:
<%
if(session.getAttribute("user")==null){
response.sendRedirect("login.jsp");
}
%>
But I am looking for a "struts solution" : i want to have as little as possible code in my jsp pages.
Thanks for your help.
Tex.