0
for (int i = 1; i <= 3; i++)
{
    ques1 = (String)request.getParameter("ques%><%=i%><%");
    out.println(ques1);
}

I just want to get the parameters from the HTML page for ques1, ques2, ques3 and so on. But it's giving unterminated String literal.

My HTML input:

Enter Question  No. <%=i%> :: <input name="ques<%=i%>"  required> 
Michael0x2a
  • 58,192
  • 30
  • 175
  • 224

1 Answers1

0

Try changing to:

for (int i = 1; i <= 3; i++)
{
    ques1 = (String)request.getParameter("ques" + i);
    out.println(ques1);
}
Kohei TAMURA
  • 4,970
  • 7
  • 25
  • 49