<% Client c = (Client)session.getAttribute("loggedClient"); if(c!=null) { // 1. Logged client -> cartSummary.jsp %> <% } else { // 2. Un-Logged client -> register.jsp %> <% } %>