大概要写成
String aaa="
for(i=0; i<9;i++){
<table>
<tr><td>
 <input type="test" name="tt" id="tt" value="'+ java中的变量 +'">
</td></tr>
</table>
}
"
请问大家以上程式的正确写法应该如何写.

解决方案 »

  1.   

    在java文件中组成 html, 然后直接到jsp 中显示
      

  2.   

    package temp;public class B { /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    String s="123";
    String aaa="for(i=0; i<9;i++){\n"+"<table>\n"+"<tr><td>\n"+"<input type=\"test\" name=\"tt\" id=\"tt\" value=\""+ s +"\">\n"+"</td></tr>\n"+"</table>\n"+"}";
    System.out.println(aaa);
    }
    }