Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¹ØÓÚ¸´Ñ¡¿òµÄÑéÖ¤ÓëjspÈ¡Öµ(תÔØ)

±íµ¥ÈçÏ£º
<form name="form1" action="test.jsp" method="post" onsubmit="return checkData();">
   <input name="checkall1" type="checkbox" value="0" onClick="checkAllBox(this);"/>È«Ñ¡<br>
   <input name="answer" type="checkbox" value="a"/>A<br>
   <input name="answer" type="checkbox" value="b"/>B<br>
   <input name="answer" type="checkbox" value="c"/>C<br>
   <input name="answer" type="checkbox" value="d"/>D<br>
   <input name="answer" type="checkbox" value="e"/>E<br>
   <input name="answer" type="checkbox" value="f"/>F<br>
</form>
È«Ñ¡¼°ÑéÖ¤javascriptÈçÏ£º
<script type="text/javascript">
function checkAllBox(obj){
 var answer= document.getElementsByName("answer");
 if(obj.checked==true){
  for(var i=0;i<answer.length;i++){
   answer[i].checked = true;
  }
 }else{
  for(var i=0;i<answer.length;i++){
   answer[i].checked = false;
  }
 }
}
function checkData(){ 
 var answer= document.getElementsByName("answer");
 var flag = false;
 for(var i=0;i<income.length;i++){
  if(income[i].checked == true){
   flag = true;
   break;
  }
 }
 if(!flag){
  alert("ÇëÖÁÉÙÑ¡ÔñÒ»Ïî");
 }
 return flag;
}
</script>
test.jspÖÐÈ¡ÖµÈçÏ£º
String[] answer= request.getParameterValues("answer");//ÕâÀïֻȡµÃÁËÑ¡ÖеÄÏÈç¹ûûÓÐÑ¡ÖÐÈκÎÒ»ÏÔòΪnull
if(answer!=null){
   for(String i:answer){
      System.out.println(i);
   }
}


Ïà¹ØÎĵµ£º

webʵÑ鱨¸æ——±íµ¥ÓëJSPÄÚÖöÔÏó

Ò»¡¢ÊµÑéÄ¿µÄ
1¡¢ ÕÆÎÕ±íµ¥µÄʹÓ÷½·¨£¬ÒÔ¼°·þÎñÆ÷¶Ë´¦Àí±íµ¥ÇëÇóµÄ·½·¨£»
2¡¢ Àí½âForwardµÄ×÷Óã»
3¡¢ ÊìÁ·ÔËÓÃJSPµÄµäÐÍÄÚÖöÔÏó
 
¶þ¡¢ÊµÑéÄÚÈݼ°²½Öè
1¡¢±íµ¥µÄʹÓü°ÆäµÝ½»¡¢´¦Àí¹ý³Ì
ÔÚÔ­´´½ÌÎñϵͳÖУ¬ÏµÍ³»á¸ù¾ÝÓû§ÀàÐÍ(½Ìʦ/ѧÉú)ÏÔʾ²»Í¬µÄÒ³Ã档ΪģÄâ¸Ã¹¦ÄÜ£¬ÐèÒª¶¨ÒåÉè¼ÆÈçÏÂҳà ......

JSP×¢ÊÍ

½ñÌìÔÚµ÷ÊÔ´úÂëʱ£¬·¢ÏÖÒ»¶ÎдÔÚjsp¶ËµÄjava´úÂëÔõô±àÒ룬ÉèÖöϵ㶼²»»áÔڶϵ㴦ͣÁô¡£°Ù˼²»µÃÆä½â£¬ÔÚͬʵİïÖúÏ£¬·¢ÏÖÊÇ´úÂë×¢ÊÍÓÐÎÊÌâ¡£
      Ô­´úÂ룺
            <!-- <jsp:forward page="/hello/Welcome.do"/> - ......

Ëѹ·Ë«ºËµÄJSP sessionÎÊÌâ

Ëѹ·Ë«ºËä¯ÀÀÆ÷³öÀ´Ö®ºó£¬ÎÒ¾ÍÓÃËüÀ´µ÷ÊÔÒ³Ã棬°´Ò»¸ö°´Å¥¿ÉÒÔÇл»Á½ÖÖä¯ÀÀÆ÷ÒÔ¹Û²ìÍøҳЧ¹û£¬»¹ÊDZȽϷ½±ãµÄ£¬µ«ÊÇ×î½ü·¢ÏÖËѹ·µÄJSP sessionòËƳöÏÖÎÊÌâ¡£»¹ÔÚ²âÊÔÖУ¬×î½üÒ»Á½Ìì»áд³öÒ»¸ö±È½ÏÏêϸµÄ²âÊÔ±¨¸æ¡£°¥£¬ÄѵÀÊÇÎÒµÄsessionдµÄÓÐÎÊÌ⣿ÔõôÔÚÍøÉÏËѲ»µ½ÀàËƵĶ«Î÷... ......

jspÖÐÈ¡µÃ·þÎñÆ÷ʱ¼ä²¢¶¯Ì¬ÏÔʾ


<%
      Calendar rightNow = Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String sysdate = format.format(rightNow.getTime());
int week = rightNow.get(rightNow.DAY_OF_WEEK);
String weekar ......

301Öض¨ÏòÉèÖü°³ÌÐò´úÂëʵÏÖÈ«¼¯(ASP|.NET|PHP|JSP)

Ê×ÏÈÉêÃ÷£ºÕâ¸öÊÇÎÒתÔصģ¬ÖÂÁ¦ÓÚΪÏñÎÒÒ»ÑùµÄÐÂÊÖÌṩ°ïÖú£¡
1¡¢IISÏÂ301ÉèÖà InternetÐÅÏ¢·þÎñ¹ÜÀíÆ÷ -> ÐéÄâĿ¼ -> Öض¨Ïòµ½URL£¬ÊäÈëÐèҪתÏòµÄÄ¿±êURL£¬²¢Ñ¡Ôñ“×ÊÔ´µÄÓÀ¾ÃÖض¨Ïò”¡£
2¡¢ASPϵÄ301תÏò´úÂë
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanent ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ