I’m using struts framework, After session expires I redirect the user to login page. Once the idle time expires, it gets redirected to the login page properly but showing the username and password in the textfields. How to clear the fields when redirected to login page?
<%
int timeout = session.getMaxInactiveInterval();
String redirect=request.getContextPath()+"/jsp/login.jsp";
response.setHeader("Refresh", timeout + "; URL ="+redirect);
response.addHeader("Cache-Control", "max-age=0,no-cache,no-store");
%>
This is the code for session expiration and redirecting to login page
You can do it by putting the value=”” in the text fields.
like,
Hope this helps.