How to handle the Exceptions in JSP, when session expires?
问题 I'm working on struts1.3.8. The JSP page contains scriptlet to iterate the data in the session. Once the user opens the page and not performing any operation till the session expires and then next refreshing it is throwing java.lang.NullPointerException . So how to handle that exception and how to make the session alive? 回答1: You can rely on the existence of a well-known attribute in session. Set this when the session is first created. session.setAttribute("well-known-attribute", "abcd"); In