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

jsp×÷Ó÷¶Î§Ð¡½á


J2EE ̽Ë÷Õß:
´´½¨ºÍ¹ÜÀíÓÐ״̬ Web Ó¦ÓóÌÐò
¶Ô4ÖֻỰ×÷ÓÃÓòµÄÊʵ±´¦Àí


ÎĵµÑ¡Ïî


½«´ËÒ³×÷Ϊµç×ÓÓʼþ·¢ËÍ

ÍØÕ¹ Tomcat Ó¦ÓÃ

ÏÂÔØ IBM ¿ªÔ´ J2EE Ó¦Ó÷þÎñÆ÷ WAS CE а汾 V1.1

¼¶±ð: ³õ¼¶
Kyle Gabhart
(kyle@gabhart.com
), ¹ËÎÊ, Gabhart Consulting
2003 Äê 9 ÔÂ 07 ÈÕ
ÔÚ´´½¨ÓÐ״̬ӦÓóÌÐòʱ£¬Êý¾Ý¹ÜÀíÊǹؼü¡£ÎªÁËÖÇÄܵعÜÀíÓû§Êý¾Ý£¬±ØÐ뽫ÆäÖÃÓÚÉÏÏÂÎÄÖУ¬Õâ¿ÉÒÔͨ¹ý ×÷ÓÃÓò£¨scope£©
À´×öµ½¡£ÔÚ±¾ÆÚµÄ J2EE ̽Ë÷Õß
ÖУ¬Java ¿ª·¢Õߺ͹ËÎÊ Kyle Gabhart¶ÔÓÃÓÚÓÐ״̬ Web Ó¦ÓóÌÐò¿ª·¢µÄ 4 ÖֻỰ×÷ÓÃÓòµÄÊʵ±´¦Àí¸øÓèÁ˹Ø×¢¡£Äú¿ÉÒÔÔÚ±¾Îĸø³öµÄ ÂÛ̳
Öй²ÏíÄú¶Ô±¾ÎÄ»òÕß J2EE ̽Ë÷Õß
ϵÁÐÖÐÈκÎÎÄÕµĿ´·¨¡£
ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«½ôË汾ϵÁеĵڶþÆÚ“ ÓÐ״̬ÍøÂçµÄ J2EE ¼¼Êõ
”¡£ÔÚÄÇÒ»ÆÚ£¬Äú¿ÉÒÔÁ˽⵽ J2EE ÖÐÓÐ״̬ӦÓóÌÐò¿ª·¢µÄһЩ»ù´¡ÖªÊ¶¡£ÕâÒ»´Î£¬ÎÒÃǽ«°Ñ×¢ÒâÁ¦´Ó´ó·¶Î§µÄ¸ÅÊöתÒƵ½ÈçºÎ´´½¨ºÍ¹ÜÀíÓÐ״̬Óû§ÌåÑéµÄϸ½ÚÉÏÀ´¡£
´´½¨ÓÐ״̬ӦÓóÌÐòµÄÒ»¸ö»ù±¾×é³É²¿·Ö¾ÍÊÇÊý¾Ý¹ÜÀí¡£Í¨¹ý´ÓÒ»¸ö»á»°È«ÃæµØÊÕ¼¯ÓйØÒ»¸öÓû§µÄÊý¾Ý£¬ÎÒÃÇ¿ÉÒÔΪÄǸöÓû§´´½¨Ò»¸ö¼òÒª±í£¨profile£©£¬È»ºóʹÓÃÕâ¸ö¼òÒª±íÀ´¸öÐÔ»¯ËûµÄÓû§ÌåÑ顣ΪÁËÖÇÄܵعÜÀíÓû§Êý¾Ý£¬±ØÐ뽫ÆäÖÃÓÚÉÏÏÂÎÄÖС£³öÓÚÕâ¸öÔ­Òò£¬ÎÒÃÇʹÓà ×÷ÓÃÓò
¡£
ÔÚ
J2EE ÖÐÓÐ 4
ÖÖ×÷ÓÃÓò£¨»òÕß˵ÉÏÏÂÎÄ£©ÓÃÓÚ¹ÜÀíÊý¾Ý£ºapplication£¨Ó¦ÓóÌÐò£©¡¢session£¨»á»°£©¡¢request£¨ÇëÇ󣩺Ípage£¨Ò³Ã棩¡£ÔÚ±¾
Ô£¬Äú½«Ñ§µ½Ã¿ÖÖ×÷ÓÃÓòΪ J2EE ÖеÄÓÐ״̬ӦÓóÌÐò¿ª·¢´øÀ´ÁËÄÄЩ¶«Î÷£¬ÒÔ¼°Ã¿ÖÖ×÷ÓÃÓò×îÊʺÏÓÚÄÄÖֻỰ¹ÜÀí³¡¾°¡£
Ê×ÏÈÎÒÃÇÀ´¿ìËٻعËһϠJ2EE ÖÐÓÐ״̬ Web Ó¦ÓóÌÐòµÄ¿ª·¢¡£
¹¹½¨ÓÐ״̬ Web Ó¦ÓóÌÐò
Èç
¹ûÓû§Ö»ÐèÒªÓà Web Ó¦ÓóÌÐòÀ´²é¿´¾²Ì¬ÄÚÈÝ£¬ÄÇô³ýÁË HTML
ÍâÎÒÃDz»ÐèÒªÈκÎÆäËûµÄ¼¼Êõ¡£µ«ÊÇ£¬³ýÁË»ùÓÚÎı¾µÄÐÅÏ¢ºÍºÃ¿´µÄ±³¾°ÑÕÉ«Ö®Í⣬´ó¶àÊýÓû§»¹Ïë´Ó Web
ÄÇÀïµÃµ½¸ü¶àµÄ¹¦ÄÜ¡£Êµ¼ÊÉÏ£¬Ä¿Ç°¶àÊýµÄÓû§·ÃÎÊÍøÂ綼ÊÇΪÁËÖ´Ðи´Ôӵĵç×ÓÉÌÎñ½»Ò×£¬²ÎÓëÔÚÏßÉçÍÅ£¬ÏÂÔØ£¨ºÍÉÏ´«£©Ã½Ì壬µÈµÈ¡£¶ÔÓÚ´ó¶àÊýÁ÷ÐÐÕ¾µãÀ´
˵£¬½»»¥ÐÔÊǹؼü£¬¶øÇÒ£¬¸öÐÔ»¯µÄ¹¦ÄÜÔ½¶àÔ½ºÃ¡£¶ÔÓÚÕâÖÖÀàÐ͵Ŀª·¢£¬ÎÒÃÇʹÓÃһЩ¸ß¼¶µÄ Web ¼¼Êõ£¬ÀýÈ


Ïà¹ØÎĵµ£º

jspѧϰ±Ê¼Ç5

JSP2.0Öеıí´ïʽÓïÑÔ(EL±í´ïʽ)
ELÓï·¨
ELµÄÓï·¨ºÜ¼òµ¥£¬Ëû×î´óµÄÌصã¾ÍÊÇʹÓÃÉϺܷ½±ã
Àý£º
${sessionScope.user.sex}
ËùÓÐEL¶¼ÊÇÒÔ ${ ΪÆðʼ¡¢ÒÔ} Ϊ½áβµÄ¡£
ÉÏÊöEL·¶ÀýµÄÒâ˼ÊÇ£º´ÓSessionÈ¡µÃÓû§µÄÐÔ±ð¡£Èç¹ûʹÓÃ֮ǰJSP´úÂëµÄд·¨ÈçÏ£º
<%
  User user = (User)session.getAttribute("user");
& ......

jspÁ¬½Ómysql¶ÔÊý¾Ý¿â½øÐвÙ×÷ÂÒÂëµÄ½â¾ö


Èç¹ûjsp²åÈëmysqlÊý¾Ý¿â³öÏÖÂÒÂ룬mysqlÊý¾Ý¿â°²×°Ê±±àÂëÉèΪutf8£¬ÔÚÖ´ÐвåÈëÓï¾äµÄÇ°Ã棨½ô°¤×ÅÖ´ÐÐÓï¾ä£©Ìí¼ÓתÂëÓï¾ä£ºString na="";
                  try{
          &nbs ......

jspµÄ°Ë¸öÒþº¬¶ÔÏó

Ò»¡¢page ¶ÔÏó
    page¶ÔÏó´ú±íJSP±¾Éí£¬¸ü׼ȷµØ˵Ëü´ú±íJSP±»×ªÒëºóµÄServlet£¬Ëü¿ÉÒÔµ÷ÓÃServletÀàËù¶¨ÒåµÄ·½·¨¡£
   
¶þ¡¢config ¶ÔÏó
    config ¶ÔÏóÀï´æ·Å×ÅһЩServlet ³õʼµÄÊý¾Ý½á¹¹¡£
    config ¶ÔÏóʵÏÖÓÚjavax.servlet.ServletConfig ½Ó ......

JSPÒ³Ãæ¼ä´«µÝ²ÎÊý·½·¨½éÉÜ


JSPÒ³Ãæ¼ä´«µÝ²ÎÊý·½·¨½éÉÜ
±¾ÎĽéÉÜÁËJSPÒ³Ãæ¼ä´«µÝ²ÎÊýµÄ¼¸¸ö·½·¨¡£×îÖ±½ÓµÄ·½·¨¾ÍÊÇÖ±½ÓÔÚURLÇëÇóºóÌí¼Ó£¬²»¹ý¶à¸öÒ³ÃæµÄÇé¿ö»á¸´ÔÓһЩ¡£
JSPÒ³Ãæ¼ä´«µÝ²ÎÊýÊǾ­³£ÐèҪʹÓõ½µÄ¹¦ÄÜ£¬ÓÐʱ»¹ÐèÒª¶à¸öJSPÒ³Ãæ¼ä´«µÝ²ÎÊý¡£ÏÂÃæ½éÉÜÒ»ÏÂʵÏֵķ½·¨¡£
£¨1£©Ö±½ÓÔÚURLÇëÇóºóÌí¼Ó
È磺< a href="thexuan.jsp?action=t ......

jspÒ³ÃædivÓ¦ÓÃ

<%@ page contentType="text/html;charset=GBK"%>
<div id="divDisable" style="display: none;width:expression(document.body.offsetWidth); height:100%; z-index: 1000; position: absolute;left: 0px; top: 0px;filter:alpha(opacity=50); background-color:White">
</div>
<div id="divWaiti ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ