jsp ¹ýÂËÆ÷ºÍ¼àÌýÆ÷
ת×Ô£ºhttp://www.blogjava.net/beansoft/archive/2007/11/09/159374.html
¼ÙÉèÓÐÒ»¸ö·Ç³£Î£ÏÕµÄÈÎÎñ, ÊǾÅËÀÒ»Éú. ÐèÒªÄã´§×ÅÕ¨Ò©°ü´Ó±±Æ½¿ª³µ×߸ßËÙ·¹ý±£¶¨È¥Ê¯¼Òׯ°Ñ¹í×ӵĵﱤ¸øÕ¨ÁË. ×¢Òâ: Õâ¸öÈÎÎñÊ®·Ö¼è¾Þ, ÓпÉÄÜ°ë·ըҩ±¬Õ¨. ËùÒÔ³ö·¢Ç°ÄãÐèÒª¿àÁ·10ÔªÒ»±¾µÄ<<Ìú²¼ÉÀ>>, »¹ÐèÒªÁ¢ÒÅÖö½»´úһϺóÊÂ. ÏÂÃæÊÇ·Ïßͼ:
ȥʱ·Ïß: ±±Æ½ ==> ¸ßËÙ·ÊÕ·ÑÕ¾Èë¿Ú(¶¼Óо¯²ìºÍ¾¯È®) A ==> ±£¶¨ÊÕ·ÑÕ¾ B ==> ʯ¼ÒׯÊÕ·ÑÕ¾ C ==> Õ¨µï±¤ D ==> ת³µ(¸Õ²ÅµÄ³µÒѾըûÁË) E =>
»ØÀ´Â·Ïß: ʯ¼ÒׯÊÕ·ÑÕ¾ ==> ±£¶¨ÊÕ·ÑÕ¾ ==> ¸ßËÙ·ÊÕ·ÑÕ¾³ö¿Ú(¶¼Óо¯²ìºÍ¾¯È®) A ==> °²È«»Øµ½±±Æ½ G
ÄÇôÎÒÃÇÏȼò½é¿ÉÄÜ·¢ÉúµÄÇé¿ö. A µãÓпÉÄܱ»¾¯²ìºÍ¾¯È®·¢ÏÖ, ËùÒÔÄãÖ»Äܱ»Å¤Ëͻر±Æ½. ¼´Ê¹²»±»·¢ÏÖ, »¹¿ÉÄܳöÏÖÊÕ·Ñʱ·¢ÏÖ10¸öÏÖ´óÑóÒ»¸ö·¿ÚµÄÂò·Ǯû´ø!! °¥, Ö»ÄÜÓÖ»ØÈ¥ÁË. »¹ÓÐ×î²ÒµÄ: ¸ßËÙ·Èë¿Úд×Å: ¶Ô²»Æð, µ½Ê¯¼ÒׯµÄ·ÏßÒòΪʩ¹¤²»Í¨! Ö»ºÃ»Ø¼ÒµÈ×Å°É.
µ½ÁËBºÍCÄã¿ÉÄÜ»¹»á±»ÈË·¢ÏÖ´øÁËÕ¨Ò©°ü, »òÕß·¢ÏÖÂò··ÑÉÙ´øÁË! ¼«ÓпÉÄÜÓÖ±»Å¤Ëͻر±Æ½, ×¢ÒâÒѾÔÚ°ëµÀÁË, ÊDz»»áÈÃÄã¼ÌÐøµ½Ê¯¼ÒׯµÄ, ËùÒÔÄã»á±»´Ó³µÉÏ´þÏÂÀ´, È»ºóתµ½¾¯³µÉÏ´ø»ØÀ´! Ò²¾ÍÊÇ´Ó B »òÕß C Ö±½Ó·µ»Ø.
ºÃÁË, ×î¼ÑÇé¿ö¾ÍÊÇÄãÕ¨Á˵ﱤ, Ò²³É¹¦µÄ·µ»ØÁË. È»ºóÄã¿ÉÒÔ¿ªÐĵİÑ<<Ìú²¼ÉÀ>>ÈÓÁË, È»ºóÐû¸æÒÅÖö×÷·Ï.
OK, ÒÔÉϹý³Ì, ¾ÍÊǹýÂËÆ÷ºÍ¼àÌýÆ÷µÄÕæʵ°¸Àý.
ÄÇôըµï±¤Õâ¸öÈÎÎñ, ¾ÍÏ൱ÓÚÒªµ÷Óà JSP »òÕß Servlet À´»ñµÃÖ´Ðнá¹û(Õ¨µï±¤ D ). ÔÚÖ´ÐÐ֮ǰÄãÐèÒª×öһЩ׼±¸¹¤×÷, Ï൱ÓÚҪдһ¸ö
¼àÌýÆ÷ com.allanlxf.ums.web.ServiceListener
ÔÚÀïÃæÄã¿ÉÒÔ×öһЩÊÂÇéÀýÈç³õʼ»¯×ÊÔ´, ÀýÈçÉÏÎĵĿàÁ·<<Ìú²¼ÉÀ>>, Á¢ÒÅÖö, Õâ¸öÏ൱ÓÚ´úÂëÖеÄ
public void contextInitialized(ServletContextEvent sce) ÕâÑùÒ»¸ö³õʼ»¯Ê¼þ.
ÄÇôÔÚÕû¸öÈÎÎñÍê³ÉÖ®ºó, ÕâЩÊÂÇéÄã¾ÍÒª¿¼ÂÇÓ¦¸Ã×÷·ÏÁË, ËùÒÔÐèÒª
public void contextDestroyed(ServletContextEvent sce) ÕâÑùÒ»¸öÏú»Ùʼþ, ÀýÈç°Ñ<<Ìú²¼ÉÀ>>ÈÓÁË, È»ºóÐû¸æÒÅÖö×÷·Ï, Ò²¾ÍÊÇÊÕ»Ø×ÊÔ´.
ÄÇô¹ýÂËÆ÷ÔÚÄÄÀïÄØ? ËüλÓÚÈÎÎñµÄ A B C µã. ×¢ÒâÊÇË«Ïò·³Ì¶¼»á¾¹ýµÄ. Ò²¾ÍÊÇÇëÇóºÍÏìÓ¦¶¼»á¾¹ý. µ«ÊǹýÂËÆ÷Ò²»á¼ì²é²»Í¬µÄÇé¿ö, ÀýÈç A µãʵ¼ÊÉÏÓÐÁ½¸ö¹ýÂ˹¦ÄÜ: ²éÕ¨Ò©°üºÍÊÕÂò·Ǯ. Õâ¾ÍÏ൱ÓÚÅäÖÃÁË:
Ïà¹ØÎĵµ£º
ÏÖÔÚÖ÷Á÷µÄÍøÕ¾¿ª·¢ÓïÑÔÎÞÍâºõasp¡¢php¡¢asp.net¡¢jspµÈ¡£
ÍøÒ³´Ó¿ªÊ¼¼òµ¥µÄhmtlµ½¸´ÔӵķþÎñÓïÑÔ£¬×ß¹ýÁË10¶à¸öÄêÍ·£¬¸÷ÖÖ¼¼Êõ²ã³ö²»Çµ¥¸öµÄÖ÷Á÷¼¼ÊõÒ²ÔÚ²»¶Ï·Ðµİ汾£¬ÏÖÔÚ·ÖÎöϸ÷ÖÖÓïÑÔµÄÇø±ð¡¢ÓÅÊÆ¡¢ÁÓÊÆ¡¢¿ª·¢×¢ÒâÊÂÏ
......
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http- ......
ÓÃJSP¹¹½¨¶¯Ì¬ÍøÕ¾ ËïÒÔÒå ¶Å¾é
Ò»¡¢ ʲôÊÇJSP JSP(JavaServer Pages)ÊÇÓÉSun Microsystems¹«Ë¾³«µ¼¡¢Ðí¶à¹«Ë¾²ÎÓëÒ»Æð½¨Á¢µÄÒ»ÖÖ¶¯Ì¬ÍøÒ³¼¼Êõ±ê×¼£¬ÆäÍøַΪ
http://www.javasoft.com/products/jsp¡£ ÔÚ´«Í³µÄÍøÒ³HTMLÎļþ(*.htm,*.html)ÖмÓÈëJava³ÌÐòƬ¶Î(Scriptlet)ºÍJSP±ê¼Ç(tag)£¬¾Í¹¹
³ÉÁËJSPÍøÒ³(*.jsp)¡£Web· ......
¾³£¿´µ½jspµÄ³õѧÕßÎÊtomcatÏÂÈçºÎÅäÖÃjsp¡¢servletºÍbeanµÄÎÊÌ⣬ÓÚÊÇ×ܽáÁËÒ»ÏÂÈçºÎtomcatÏÂÅäÖÃjsp¡¢servletºÍben£¬Ï£Íû¶ÔÄÇЩ³õѧÕßÓÐËù°ïÖú¡£
µÚÒ»²½£ºÏÂÔØj2sdkºÍtomcat£ºµ½sun¹Ù·½Õ¾µã£¨http://java.sun.com/j2se/1.4.2/download.html£©ÏÂÔØj2sdk£¬×¢ÒâÏÂÔذ汾ΪWindows Offline InstallationµÄSDK£¬Í¬Ê±×îºÃÏ ......
ÀûÓÃApacheµÄÒ»¸ö ¿ªÔ´ÏîÄ¿Image Tag Library(http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/intro.html)
ÀûÓÃApacheµÄÒ»¸ö ¿ªÔ´ÏîÄ¿Image Tag Library(http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/intro.html)
ÏÂÔرØÒªÎļþ
1)ÏÂÔØJakarta-Taglibs:
http://people.apache.org/builds/jaka ......