out.print("<td>"+"<input type="radio" value="是" checked name=<%"select"+i%>/>"+"</td>");
i是一个int型值
错误见下:谢谢大家帮忙检查一下!
An error occurred at line: 70 in the jsp file: /index7.jsp
Syntax error, insert ")" to complete MethodInvocation
67:                out.print("<td>"+rs.getString(2)+"</td>");
68:                out.print("<td>"+rs.getString(3)+"</td>");
69:                out.print("<td>"+rs.getString(4)+"</td>");  
70:                out.print("<td>"+"<input type="radio" value="是" checked name=<%"select"+i%>/>"+"</td>");
71:     out.print("<td>"+"<input type="radio" value="否" name=<%"select"+i%>/>"+"</td>");
72:                out.print("</tr>");
73:     i++;
An error occurred at line: 70 in the jsp file: /index7.jsp
Syntax error, insert ";" to complete Statement
67:                out.print("<td>"+rs.getString(2)+"</td>");
68:                out.print("<td>"+rs.getString(3)+"</td>");
69:                out.print("<td>"+rs.getString(4)+"</td>");  
70:                out.print("<td>"+"<input type="radio" value="是" checked name=<%"select"+i%>/>"+"</td>");
71:     out.print("<td>"+"<input type="radio" value="否" name=<%"select"+i%>/>"+"</td>");
72:                out.print("</tr>");
73:     i++;
An error occurred at line: 70 in the jsp file: /index7.jsp
String literal is not properly closed by a double-quote
67:                out.print("<td>"+rs.getString(2)+"</td>");
68:                out.print("<td>"+rs.getString(3)+"</td>");
69:                out.print("<td>"+rs.getString(4)+"</td>");  
70:                out.print("<td>"+"<input type="radio" value="是" checked name=<%"select"+i%>/>"+"</td>");
71:     out.print("<td>"+"<input type="radio" value="否" name=<%"select"+i%>/>"+"</td>");
72:                out.print("</tr>");
73:     i++;

解决方案 »

  1.   

    out.print(" <td>" + " <input type=\"radio\" value=\"是\" checked name= \"select" + i + "/>" + " </td>"); 应该这样吧
      

  2.   

    很明显你拼字符串引号有问题,还有你用<%  %>做什么呢
      

  3.   


    out.print(" <td>"+" <input type=\"radio\" value=\"是\" checked name= <%=select"+i+"%>/></td>"); 
      

  4.   

    out.print(" <td>"+" <input type="radio" value="是" checked name= <%"select"+i%>/>"+" </td>");out.print(" <td>"+" <input type='radio' value='是' checked name= 'select"+<%=i%>+"' />"+" </td>");
      

  5.   

    out.print(" <td>"+" <input type="radio" value="是" checked name= <%"select"+i%>/>"+" </td>"); 
    我的意思是这样的:
    我想设置name的名字为一个字符串常量“select”与一个int型的值的组合所形成的字符串,
    还有就是引号具体该怎么放置呢?
      

  6.   

    你用System.out.println()打印出来,和写在html里一样就可以了。
      

  7.   

    out.print里面的都需要转义。
    如果使用<%%>,是用在程序或程序段,引用变量要用<%=%>