Home > Tutorials > Examples > SimpleLogin with Session |

Apache Struts 2 Documentation
SimpleLogin with Session
Edit Page Browse Space Add Page Add News

I wrote this simple application to demostrate login/logout.

/Login.jsp

/pages/welcome.jsp

/WEB-INF/inc/loginCheck.jsp

<%@ taglib="/webwork" prefix="ww" %>
<ww:if test="#session.login != 'true'">
<jsp:forward page="<%= request.getContextPath() %>/login.jsp" />
</ww:if>

simple.LoginAction.java

simple.LogoutAction.java

/WEB-INF/classes/xwork.xml