JSP/servlet¿ª·¢µãµÎ
1.²¿ÊðÈýÖÖ·½Ê½£º
(1) ÔÚserver.xmlµÄHost±êÇ©ÄÚн¨Ò»¸öContext±êÇ©
<Context path="/learn1" reloadable="true" docBase="E:\work\tech\project\learn1\WebRoot" workDir="E:\work\tech\project\learn1\WebRoot\work" />
* workDirÊÇÖ¸Tomcat½âÎöJspת»»ÎªJavaÎļþ£¬²¢±àÒëΪclass´æ·ÅµÄÎļþ¼Ð£¬ÉèÖÃÔÚÏîÄ¿Îļþ¼ÐÀïÃ棬¿ÉÒÔ±ÜÃâÒÆÖ²µ½ÆäËûµØ·½Ê״ζÁÈ¡jspÎļþÐèÒªÖØнâÎö ¡£Ò»°ã¸ñʽ£ºÏîÄ¿Îļþ¼Ð\work
(2) ·ÅÔÚtomcatµÄwebappsÏÂ
(3) ÔÚtomcatµÄconf\Catalina\localhostϽ¨Á¢Ò»Îļþ <·ÃÎÊ·¾¶>.xml, ÄÚÈÝͬ(1)
Ïà¹ØÎĵµ£º
×òÌìÔÚ䶫Î÷µÄʱºò£¬Êý¾Ý¿âÓõıàÂëÊǣգԣƣ£¸£¬Ò³ÃæÒ²Êǣգԣƣ£¸£¬È»ºó´æ½øÊý¾Ý¿âµÄʱ·¢ÏÖ»¹ÊÇÂÒÂë¡£ÖÐÎĵÄʱºò£¬Ëæºó£ä£å£â£õ£ç£¬²éµ½£Á£ã£ô£é£ï£îÀïÃæµÃµ½µÄ±íµ¥ÄÚÈÝÒ²ÊÇÂÒÂ룬¹þ¹þ
ÎÊÌâÕÒµ½ÁË£¬ÔÀ´Êǣƣï£ò£í±íµ¥»òÕßÆäËûµØ·½ÓÐÎÊÌâ
ºóÀ´ÔÚ£÷£å£â£®£ø£í£ìÖмÓÉ϶ԣӣð£ò£é£î£ç±àÂëµÄ¿ØÖÆÓï¾ä£¬ºÃÁË£®£®£®ºÇºÇ
......
ÔÚJSPÖÐÒýÓÃjsÎļþ»á·¢ÉúÒýÓò»µ½µÄÎÊÌ⣺
ÔÚwebÏîÄ¿À´æÔÚWEB-INFÎļþĿ¼£¬ÎҵĴíÎó×ö·¨ÊÇ°Ñjs£¬image£¬CSS¶¼·ÅÔÚ´ËÎļþ¼ÐÏ¡£×î³õÒÔΪÊÇÏà¶Ô·¾¶Óë¾ø¶Ô·¾¶¸ã´íÁË£¬µ«ÊÇÔõôÐÞ¸ÄÒ²ÎÞ·¨½â¾öÎÊÌâ¡£µ÷ÓÃjsʱ×ÜÊǻᱨȱÉÙ¶ÔÏó£¬×îºóÁ˽âÊÇÒòΪWEB-INFÕâÀïµÄ¶«Î÷ÊDz»ÈÃÖ±½Ó·ÃÎʵġ£ËùÒԸı䷽·¨°ÑÕâЩΠ......
request, reponse, out, session, application, config, pagecontext, page, exception.
Ò».request¶ÔÏ󣺸öÔÏó·â×°ÁËÓû§Ìá½»µÄÐÅÏ¢£¬Í¨¹ýµ÷ÓøöÔÏóÏàÓ¦µÄ·½·¨¿ÉÒÔ»ñÈ¡·â×°µÄÐÅÏ¢£¬¼´Ê¹ÓøöÔÏó¿ÉÒÔ»ñÈ¡Óû§Ìá½»ÐÅÏ¢¡£
1.Request¶ÔÏó¿ÉÒÔʹÓÃgetParameter(string s)·½·¨»ñÈ¡¸Ã±íµ¥Í¨¹ýtextÌá½»µÄÐÅÏ¢¡£È磺
Requ ......
JSPºÍSERVLETµ½µ×ÔÚÓ¦ÓÃÉÏÓÐʲôÇø±ð£¬ºÜ¶àÈ˸㲻Çå³þ¡£ÎÒÀ´ºú³¶¼¸¾ä°É¡£¼òµ¥µÄ˵£¬SUNÊ×ÏÈ·¢Õ¹³öSERVLET£¬Æ书ÄܱȽÏÇ¿¾¢£¬ÌåϵÉè¼ÆÒ²ºÜÏȽø£¬Ö»ÊÇ£¬ËüÊä³öHTMLÓï¾ä»¹ÊDzÉÓÃÁËÀϵÄCGI·½Ê½£¬ÊÇÒ»¾äÒ»¾äÊä³ö£¬ËùÒÔ£¬±àдºÍÐÞ¸ÄHTML·Ç³£²»·½±ã¡£
ºóÀ´SUNÍƳöÁËÀàËÆÓÚASPµÄÏâǶÐ͵ÄJSP£¬°ÑJSP TAGÏâǶµ½HTMLÓï¾äÖУ¬ÕâÑù£¬¾Í ......