在 jsp 页面中,变量在页面刷新后保留其值。我想在每次页面刷新时将变量的值分配为零,该怎么做?
<%!
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>
一旦我的页面刷新,我的i
值应该重新初始化为零。