java中一个对象后面加冒号然后再加上一段代码是什么意思
List<Question> qlist=qdao.listAllQuestion(Long.valueOf(request.getParameter("sid")));
//String obj=request.getParameter("obj");
String to=request.getParameter("to");
qlist:
for(Question q:qlist){
if(q.getQId()<Long.valueOf(to))
continue;//this is to avoid generate the same question.
out.println("<li> "+q.getQHead() +" </li>");
out.println("<ul type='1'>");
String [] body=q.getQBody().split("&\\$\\$&");
String[] sz_jdtz;
int Jdtz;
switch(q.getQType().intValue()){
case 1:
sz_jdtz =q.getQJdtz().split("&");
//Jdtz=0;
for(int i=0;i<body.length;i++){
if("over".equals(sz_jdtz[i]))
out.println("<li><input type='radio' name='answer"+q.getQId()+"' value='"+i+"' onclick='EndSurvey("+q.getQId()+")'>"+body[i]+"</li>");
else if("null".equals(sz_jdtz[i])){
out.println("<li><input type='radio' name='answer"+q.getQId()+"' value='"+i+"' onclick=showNext('qbox"+q.getQId()+"',"+(q.getQId()+1)+")>"+body[i]+"</li>");
// Jdtz++;
}else{
out.println("<li><input type='radio' name='answer"+q.getQId()+"' value='"+i+"' onclick=jump('qbox"+q.getQId()+"',"+sz_jdtz[i]+")>"+body[i]+"</li>");
}
}
out.println("</ul><br/>");
out.println("<div id=qbox"+q.getQId()+"></div>");
//if(Jdtz==body.length)
//break;
//else
break qlist;// this is a 'single choice' , it may have jump or break,so stop generate list,wait for user's choice.
------解决方案--------------------这是循环标记,方便跳出循环,尤其是多重循环
你看一下这篇文章:http://lihengzkj.iteye.com/blog/1090034