In a jsp page, a variable is retaining its value after the page is refreshed. I want to assign a value of a variable to zero every time the page refreshes, how to do that?
<%!
String s[] = new String[100];
String s1[] = new String[100];
int i=0;
%>
<html>
<head>
<s:iterator value="data">
<%
s1[i]=(String)request.getAttribute("build_id");
s[i]=(String)request.getAttribute("bui_id");
i++;
%>
</s:iterator>
</head>
</html>
Here my i
value should be re-initialized to zero, once my page refreshes.