you can create a filter and then check for this and redirect
if(session != null && !session.isNew())
chain.doFilter(request, response);
else
response.sendRedirect("/myhomepage.jsp");
Another one Interesting Answer is following as:
redirect a page in JSP. You can see in the given example that have been used to the method of response.sendRedirect() through which the server sends the response to the client browser, from where the next request comes and it displays that url correctly. You can also redirect the jsp page in a jsp.
Here is the code of redirect.jsp
<html>
<%
String redirectURL = "http://www.stackoverflow.net/";
response.sendRedirect(redirectURL);
%>
</html>