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)
Ïà¹ØÎĵµ£º
1. Tomcat¶Ë¿ÚÅäÖÃ
¿ÉÒÔÔÚTomcat·þÎñÆ÷µÄconfÎļþϵÄÖ÷ÅäÖÃÎļþserver.xmlÖеÄÀ´¸ü¸Ä¶Ë¿ÚºÅ¡£
Èç¹ûTomcat·þÎñÆ÷ËùÔڵļÆËã»úûÓÐÆô¶¯ÆäËûµÄÕ¼ÓÐ80¶Ë¿ÚºÅµÄÍøÂç³ÌÐò£¬Ò²¿ÉÒÔ½«Tomcat·þÎñÆ÷µÄ¶Ë¿ÚºÅÉèÖÃΪ80£¬ÕâÑùÓû§ÔÚ·ÃÎÊTomcatµÄ·þÎñÆ÷µÄʱºò¾Í¿ÉÒÔÊ¡ÂԶ˿ںţ¬ÀýÈ磺http£º// ......
ÏÖÔÚÖ÷Á÷µÄÍøÕ¾¿ª·¢ÓïÑÔÎÞÍâºõasp¡¢php¡¢asp.net¡¢jspµÈ¡£
ÍøÒ³´Ó¿ªÊ¼¼òµ¥µÄhmtlµ½¸´ÔӵķþÎñÓïÑÔ£¬×ß¹ýÁË10¶à¸öÄêÍ·£¬¸÷ÖÖ¼¼Êõ²ã³ö²»Çµ¥¸öµÄÖ÷Á÷¼¼ÊõÒ²ÔÚ²»¶Ï·Ðµİ汾£¬ÏÖÔÚ·ÖÎöϸ÷ÖÖÓïÑÔµÄÇø±ð¡¢ÓÅÊÆ¡¢ÁÓÊÆ¡¢¿ª·¢×¢ÒâÊÂÏ
HTML:µ±È»ÕâÊÇÍøÒ³×î»ù±¾µÄÓïÑÔ,ÿһ¸ö·þÎñÆ÷ÓïÑÔ¶¼ÐèÒªËüµÄÖ§³Ö,Ҫѧϰ,Õâ¸ö¿Ï¶¨ÊÇ¿ªÊ¼ ......
×î½üÊÕµ½Ò»¸öÏîÄ¿µÄÔ´´úÂ룬²¿ÊðÒÔºó´ò¿ªÒ³Ãæ·¢ÏÖJSPÒ³ÃæÖеÄEL±í´ïʽ¶¼Ã»ÓнâÎö£¬¶¼ÊÇÔÑùÏÔʾ¡£
ÉÏÍøËÑË÷ÁËÒ»ÏÂÔÒò£¬ÔÀ´ÊÇServlet°æ±¾µÄÎÊÌâ¡£ÔÀ´ServletÖпÉÒÔÉ趨ÊÇ·ñ½âÎöEL±í´ïʽ£¬Ö»ÓÐ2.4°æ±¾µÄServletĬÈÏÊǽâÎöEL±í´ïʽµÄ£¬¶øÆäËû°æ±¾ÊÇĬÈϲ»½âÎöEL±í´ïʽ£¬²éÁËһϳÌÐò£ ......
JSPºÍSERVLETµ½µ×ÔÚÓ¦ÓÃÉÏÓÐÊ²Ã´Çø±ð£¬ºÜ¶àÈ˸㲻Çå³þ¡£ÎÒÀ´ºú³¶¼¸¾ä°É¡£¼òµ¥µÄ˵£¬SUNÊ×ÏÈ·¢Õ¹³öSERVLET£¬Æä¹¦ÄܱȽÏÇ¿¾¢£¬ÌåϵÉè¼ÆÒ²ºÜÏȽø£¬Ö»ÊÇ£¬ËüÊä³öHTMLÓï¾ä»¹ÊDzÉÓÃÁËÀϵÄCGI·½Ê½£¬ÊÇÒ»¾äÒ»¾äÊä³ö£¬ËùÒÔ£¬±àдºÍÐÞ¸ÄHTML·Ç³£²»·½±ã¡£
ºóÀ´SUNÍÆ³öÁËÀàËÆÓÚASPµÄÏâǶÐ͵ÄJSP£¬°ÑJSP TAGÏâǶµ½HTMLÓï¾äÖУ¬ÕâÑù£¬¾Í ......
Ò»¡¢JSP¼ò½é
JSP (Java Server Pages)ÊÇ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ£¬ÊÇÒ»ÖÖÔÚHTMLÒ³ÃæÖмÓÈëJavaÓïÑÔ¶øÉú³É¶¯Ì¬Ò³ÃæµÄ¼¼Êõ£º¼ÓÈëÁËеıêÇ©£¨<%£¬%>£¬…£©¡£
JSPÊÇÒÔJavaºÍServletΪ»ù´¡¿ª·¢¶ø³ÉµÄ¶¯Ì¬ÍøÒ³Éú³É¼¼Êõ£¬ËüµÄµ×²ãʵÏÖÊÇJava Servlet¡£
JSPÒ³ÃæÓÉHTML´úÂëºÍǶÈëÆäÖеÄJava´úÂëËù×é³É¡£·þÎñÆ÷ÔÚÒ³Ãæ±»¿Í» ......