<%
if(session.getAttribute("name") == null){
response.sendRedirect("login.jsp");
}
%>
Adding this in my index.jsp file causes me to get the message in the Title.
Problem
“signup” is the name of project.
Without this, the code works fine and the page opens in browser. “login.jsp” is also placed in the correct location
Files location.
Application Server: Tomcat 10.1.23
Tomcat Server Settings:
- HTTP port: 8080
- JMX port: 1099
Tried to add the context path but still no luck.
<%
if (session.getAttribute("name") == null) {
response.sendRedirect(request.getContextPath() + "/login.jsp");
}
%>
New contributor
Ojasva Manik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.