I'd suggest you have your action return some agreed upon value ("NOSESSION" for example) if the session has expired. In your JavaScript on the client side, you can then check for this value and cause the login
JSP to be displayed:
location.replace("login.jsp");