ArrayList<String> cs = CourseAssignments.getInstance().getStudentCoursesByName(sname); 

                  <table border="1" cellspacing="1" cellpadding="8" bgcolor= #EBDDE2> 

                Iterator<String> i = cs.iterator();
                  <td><%= %><input type= "radio" name= "courses" value="<%= %>"/></td>
              <center><input type= "submit" value= "Submit"></center>

In ArrayList cs I have all the courses that a student has.
In a table I show these courses and it works if I don't use RADIO input.
I want to display a radio button near each course, then user selects one and I will display the marks for that course.
I get: "org.apache.jasper.JasperException: An exception occurred processing JSP page /ComplexSearch/Seek.jsp at line 61

58:                 while(i.hasNext()){
59:                 %>
60:                 <tr>
61:                   <td><%= %><input type= "radio" name= "courses" value="<%= %>"/></td>
62:                 </tr>
63:                 <%}%>
64:             </table>

    java.util.ArrayList$ Source)


Of course because you use twice on same line therefore you move to possitions. So if you have followinf courses in arraylist {"math", "english", "java", "c++", "php"}
when you come acrros <%= %> it will get math but when you hit value="<%= %>" it will get english and so on. That on its own wouldn' cause problem beside title of row and actual value of radio wouldn't match, your problem i sthat you have array size that is odd number so when it reads php there is no pair value.
You should store value into temporary string that you can then use instead of double of Other option is to use for each loop

ArrayList<String> cs = CourseAssignments.getInstance().getStudentCoursesByName(sname);
for(String course : cs){%>
        <td><%= course %><input type= "radio" name= "courses" value="<%= course %>"/></td>