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

JspÖÐÓÃsession±£´æ¼¯ºÏ ÁíÒ»Ò³ÃæÈ¡³öʱΪ¿Õ£¡

ÔÚÉÏÒ»Ò³Ãæ´æ´¢Ê±µÄ´úÂë¡£
<%
List foodList = new ArrayList();

//ÕâÊÇ´ÓÊý¾Ý¿âÖлñÈ¡List£¬·½·¨·µ»ØÀàÐÍΪList.
foodList = getDataBean.getAllFoodInfo();
session.setAttribute("FOODS", foodList);
%>


ÐèÒªÌáÈ¡¼¯ºÏÒ³Ãæ´úÂë
<%

List foodList = new ArrayList();

//»ñÈ¡Session¶ÔÏóÖд洢µÄList£¬È¡³öΪ¿Õ¡£
foodList = (List)session.getAttribute("FOODS");

// if(foodList == null){
// out.print("¼¯ºÏΪ¿Õ~£¡");
// return;
// }
FoodBean foodBean = null;
//»ñÈ¡´«µÝ¹ýÀ´µÄ²ÎÊý(²ÍÆ·id)
String foodID = request.getParameter("foodID");
int i = 0;
//ÀûÓÃÑ­»·Óï¾äÒÀ´ÎÈ¡³ö¡¾ÔËÐÐʱ´Ë´¦Ìáʾjava.lang.NullPointerException¡¿
while(i < foodList.size()){
foodBean = (FoodBean)foodList.get(i);
//ÔÚÕâÀï±ÈÕÕ²ÍÆ·id¡£Èç¹ûÏàͬ¾ÍÊÇÒªÏÔʾÏêϸÐÅÏ¢µÄ²ÍÆ·¶ÔÏó
if(foodID.equals(foodBean.getFoodID())){
session.setAttribute("FoodToAdd", foodBean);
break;
}
i++;
}
%>


ÉÏÃæΪ³ö´í¼°Ïà¹Ø²¿·Ö´úÂ룬ÇëÖ¸µã¡£
ÄãҪȷ¶¨ÊÇͬһ¸ösessionѽ
ÖмäÄ㶼¸ÉʲôÁË

û¸Éʲô°¡£¬¾ÍÔÚÉÏÒ»¸öÒ³Ãæ´æ´¢ºó£¬°Ñ¼¯ºÏÖд洢µÄÐÅÏ¢ÏÔʾÔÚÁËÍøÒ³ÉÏÃæ¡£
ÔÚÐèÒª¶ÁÈ¡¼¯ºÏµÄÒ³ÃæÖ±½Ó¶ÁÈ¡ÁË£¬Ã»×öÆäËû²Ù×÷

°´µÀÀíÀ´ËµÊDz»Ó¦¸ÃµÄ,°Ñ²Ù×÷µÄ˳Ðò˵һÏ°É.°üÀ¨ÊÇ·ñ´ò¿ªÐÂIEµÈ.
{{---


Ïà¹ØÎÊ´ð£º

JSPÈÕÆÚ

ÔÚASPϵıäÁ¿£¬Èç¡°2009-09-09¡°£¬×÷Ϊ²ÎÊý£¬´«ÈëJSPº¯ÊýÄÚ£¬±äΪÂÒÂ룬ÇëÎÊÈçºÎ½â¾ö

asp´«µ½jsp?ûÅö¹ý...up up

¸ñʽ»¯°¡£¡

ASPÖÐÈÕÆÚÊDz»ÊÇÒÔ×Ö·û´®µÄÐÎʽ´«ÈëJSPº¯ÊýÖеģ¿
Èç¹û²»ÊÇ×Ö·û´®µÄ»°£ ......

¹ØÓÚjspÂÛ̳ - Java / Web ¿ª·¢

ÎÒÏÖÔÚÏëÓÃsshÕûºÏÀ´×öÒ»¸öÂÛ̳£¬µ«Êý¾Ý¿â·½Ãæ²»ÐУ¬ÎÒÖ÷Òª²»»áÉæ¼°Êý¾Ý¿â£¬²»ÖªµÀ·¢Ìû±í£¬ºÍ»ØÌû±íÒªÈçºÎÉè¼ÆºÍÇø·Ö¡£²»ÖªµÀË­ÓÐÒ»¸ö¼òµ¥µÄ˼·£¬À´Éè¼ÆÕâЩ±í¡£Ð»Ð»ÁË¡£
·¢ÌûºÍ»ØÌûÓÃͬһÕÅ±í ¡£·¢Ìû id user ......

Çó¾È¸ßÊÖ-----jspÖÐselectÎÊÌâ

ÔÚjspÀïÃ棬Óøöselect¼ÈÄÜÊäÈë×Ô¶¯Æ¥ÅäÓÖÄÜÏÂÀ­Ñ¡ÔñµÄ£¬ÔõôʵÏÖ£¿
²»»á¡£¡£¡£¡£¡£¡£°ï¶¥  ѧϰ¡£¡£

×Ô¶¯Æ¥ÅäʲôÒâ˼£¿¾ßÌåµã

¾ÍÊÇÄãÊäÈëÄÚÈݺ󣬺ÍÄãÄÚÈÝÏàͬѡÏîµÄ¶¼ÁгöÀ´

ÄãselectÊÇÏÂÀ­¿ò¡£¡£ ......

ÇóÒ»¸öjspºÍservletµÄ½â¾ö·½·¨

´ó¼ÒºÃ£¡ÎÒÏÖÔÚÔÚ×öÒ»¸öÍøÉÏÊéµê£¬Óöµ½Ò»Ð©ÎÊÌ⣬ÇóÖúÏ£º

ÒªÇóÊÇÕâÑùµÄ£º

°ÑÒ»±¾ÊéÍϽøÒ»¸ö¹ºÎï³µ£¬¹ºÎï³µ¾Í¶àÁËÕâ±¾Ê飬

´Ó¹ºÎï³µÍϳöÒ»±¾Ê飬Ȼºó¹ºÎï³µ¾ÍÉÙÁËÕâ±¾Ê飻

¸ßÊÖÇëÖ¸µãÏ ......

JSPÒ³Ãæ±íµ¥Ìá½»ÎÊÌ⣿

<script language="javaScript">
function select()
{
document.selectpages.selectnum.value=document.selectpages.selectpage.value;
document.selectpages.submit();
}
&l ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ