JSP µÃµ½Ò³Ãæµã»÷radioµÄÖµ
<SCRIPT LANGUAGE="JavaScript">
var tt = "";
var flag = false;
var radios = document.getElementsByName("t1");//´ÓjspÖÐÈ¡radioµÄid»òradioµÄname
for(var i=0;i<radios.length;i++){
//Èç¹ûµ±Ç°ÓÐÑ¡ÖÐ
if(radios[i].checked == true){
//¸³Öµ
tt = radios[i].value;
//¸³Öµ
flag = true;
//½áÊøÑ»·
break;
}
}
//ÅÐ¶Ï radio ÊÇ·ñÓÐÑ¡ÖÐ
if(!flag){
alert("No choose");
return;
}else{
alert(tt);
}
</SCRIPT>
Ïà¹ØÎĵµ£º
1.request¶ÔÏó
¸Ã¶ÔÏó·â×°ÁËÓû§Ìá½»µÄÐÅÏ¢£¬Í¨¹ýµ÷ÓøöÔÏóµÄÏìÓ¦µÄ·½·¨¿ÉÒÔ»ñÈ¡Óû§Ìá½»µÄÐÅÏ¢¡£
µ±request¶ÔÏó»ñÈ¡Óû§Ìá½»µÄºº×Ö×Ö·ûʱ£¬»á²úÉúÂÒÂ룬ÓÉÏÂÃæµÄ·½·¨¿ÉÒÔ½â¾ö£º
Sting s2 = new String(s1.getBytes("iso8859-1"),"GB2312")½øÐÐת»»¡£
request³£Óõķ½·¨ ......
<%
ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
List stafflist = ((StaffDAO)ctx.getBean("StaffDAO")).findAll();
request.setAttribute("stafflist",stafflist);
%> ......
¼¸ºõËùÓеÄWeb¿ª·¢ÓïÑÔ¶¼Ö§³ÖSession¹¦ÄÜ£¬ServletÒ²²»ÀýÍâ¡£ Servlet/JSPÖеÄSession¹¦ÄÜÊÇͨ¹ý×÷ÓÃÓò(scope)Õâ¸ö¸ÅÄîÀ´ÊµÏֵġ£
×÷ÓÃÓò·ÖΪËÄÖÖ£¬·Ö±ðΪ£º
page
ÔÚµ±Ç°Ò³ÃæÓÐЧ(½öÓÃÓÚJSPÖÐ)
request
ÔÚµ±Ç°ÇëÇóÖÐÓÐЧ
session
ÔÚµ±Ç°»á»°ÖÐÓÐЧ
application
ÔÚËùÓÐÓ¦ÓóÌÐòÖÐÓÐЧ
ÊDz»ÊÇ¿´²»Ì«Ã÷°×£¿pageÒòΪ½ ......
JAVA×ÛºÏÃæÊÔÌâ£ºÒ³ÃæµÄץȡ¡¢½âÎö¡¢±£´æÊý¾Ý¿âºÍÉú³ÉHTMLµÄÒ³ÃæÕ¹Ê¾ ÊÕ²Ø
´ÎÀý×Ó¿ÉÒÔÓÃÀ´Ñ§Ï°ÍøÂç±à³Ì£¬ÕýÔò±í´ïʽµÄʹÓ㬷ºÐÍ£¬Êý¾Ý¿âµÄ»ù±¾²Ù×÷µÈJAVA֪ʶ
ÎÊÌâÈçÏ£ºÀ´Ô´ÓÚÂÛ̳
http://topic.csdn.net/u/20090616/13/59aa4e2d-3752-45df-9c1b-c65c46c3e4d7.html
дһ¸öjspÒ³Ãæ£¬·ÃÎÊʱÏÔʾ´ÓÏÂÃæµÄÒ³ÃæÌ ......