cyborg911
02-28-2012, 04:00 PM
I am trying to put an increment variable that gets called everytime the page loads. However when i initialize the variable "int marks=0" it sticks to that value and dosent load the incremented value marks++. I tried marking the value as static int marks=0 however it gave me a compiler error. Below is the JSP code:
<%
int marks=0;
String quesno=request.getParameter("quesno");
String option=request.getParameter("option");
String option1= request.getParameter("opt");
if(option.equals(option1))
{
marks++;
}
<%
int marks=0;
String quesno=request.getParameter("quesno");
String option=request.getParameter("option");
String option1= request.getParameter("opt");
if(option.equals(option1))
{
marks++;
}