jspѧϰ±Ê¼Ç4
JSP×Ô¶¨Òå±êÇ©£¨tag£©
ʲôÊÇ×Ô¶¨Òå±êÇ©
1£¬Óû§×Ô¶¨ÒåµÄJavaÓïÑÔÔªËØ, ʵÖÊÊÇÔËÐÐÒ»¸ö»òÕßÁ½¸ö½Ó¿ÚµÄJavaBean;
2£¬¿ÉÒԷdz£»úÃܵغÍJSPµÄ±íʾÂß¼ÁªÏµÔÚÒ»Æð£¬ÓÖ¾ßÓкÍÆÕͨJavaBeanÏàͬµÄÒµÎñÂß¼´¦ÀíÄÜÁ¦;
3£¬µ±Ò»¸öJSPÒ³Ãæת±äΪservletʱ£¬Æä¼äµÄÓû§×Ô¶¨Òå±êǩת»¯Îª²Ù×÷Ò»¸ö³ÆΪ±êÇ©handerµÄ¶ÔÏó;
4£¬¿É²Ù×÷ĬÈ϶ÔÏ󣬴¦Àí±íµ¥Êý¾Ý£¬·ÃÎÊÊý¾Ý¿âÒÔ¼°ÆäËüÆóÒµ·þÎñ;
×Ô¶¨Òå±êÇ©¿âµÄÌصã
1£¬Í¨¹ýµ÷ÓÃÒ³Ãæ´«µÝ²ÎÊýʵÏÖ¶¨ÖÆ;
2£¬·ÃÎÊËùÓжÔJSPÒ³Ãæ¿ÉÄܵĶÔÏó;
3£¬Ð޸ĵ÷ÓÃÒ³ÃæÉú³ÉµÄÏìÓ¦;
4£¬×Ô¶¨Òå±êÇ©¼ä¿ÉÏ໥ͨÐÅ;
5£¬ÔÚͬһ¸öJSPÒ³ÃæÖÐͨ¹ý±êǩǶÌ×£¬¿ÉʵÏÖ¸´ÔÓ½»»¥¡£
ÈçºÎʹÓÃ×Ô¶¨Òå±êÇ©¿â
1£¬ÉùÃ÷±êÇ©¿â
2£¬Ê¹±êÇ©¿âÖ´ÐжÔWebÓ¦ÓóÌÐò¿ÉÓÃ
ÉùÃ÷±êÇ©¿â
1£¬Ê¹ÓÃtaglibÖ¸ÁîÉùÃ÷±êÇ©¿â
2£¬Óï·¨£º<%@taglib uri="URI" prefix="pre" %>
×¢Ò⣺a. uriÊôÐÔ¿ÉÒÔÊǾø¶ÔµÄ£¬Ò²¿ÉÒÔÊÇÏà¶ÔURL£¬¸ÃURLÖ¸Ïò±ê¼Ç¿âÃèÊö·û(TLD)Îļþ;
b. uriÊôÐÔÒ²¿ÉÒÔÊÇÒ»¸ö²¢²»´æÔÚµÄURL£¬¸ÃURLΪweb.xmlÎļþÖн«±ê¼Ç¿âÃèÊö·û(TLD)ÎļþµÄ¾ø¶Ô
URLµ½±¾µØϵͳµÄÒ»¸öÓ³Éä;
3£¬·¶Àý£º<%@taglib uri="/WEB-INF/template.tld" prefix="test" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="core" %>
ʹ±êÇ©¿âÖ´ÐпÉÓÃ
·½Ê½Ò»£ºÔÚWEB-INF/classesĿ¼Ï²¿Êð±ê¼Ç´¦Àí³ÌÐòÀà;
·½Ê½¶þ£º½«±ê¼Ç´¦Àí³ÌÐòÀà´ò°ü³ÉjarÎļþ²¢ÖÃÓÚWEB-INF/libĿ¼¡£
¼¸ÖÖµäÐ͵ıêÇ©
1£¬²»´øÊôÐÔºÍÖ÷ÌåµÄ¼òµ¥±êÇ©£º<mytaglibs:SomeTag/>;
2£¬²»´øÖ÷Ì嵫ÓÐÊôÐԵıêÇ©£º<mytaglibs:SomeTag user="TonyDeng"/>;
3£¬´øÓÐÖ÷ÌåºÍÊôÐԵıêÇ©£º
<mytaglibs:SomeTag user="TonyDeng">  
Ïà¹ØÎĵµ£º
Ò»¡¢°ÑjspÒ³ÃæÊý¾Ý¸´ÖƵ½wordÎĵµ
var table=document.getElementById('printTable');
row=table.rows.length;
column=table.rows(1).cells.length;
var word = new ActiveXObject("Word.Application");
word.Application.Visible = tru ......
1.RequestDispatcher.forward()
ÊÇÔÚ·þÎñÆ÷¶ËÆð×÷ÓÃ,µ±Ê¹ÓÃforward()ʱ,Servlet engine´«µÝHTTPÇëÇó´Óµ±Ç°µÄServlet or JSPµ½ÁíÍâÒ»¸öServlet,JSP »òÆÕͨHTMLÎļþ,Ò²¼´ÄãµÄformÌá½»ÖÁa.jsp,ÔÚa.jspÓõ½ÁËforward()Öض¨ÏòÖÁb.jsp,´ËʱformÌá½»µÄËùÓÐÐÅÏ¢ÔÚb.jsp¶¼¿ÉÒÔ»ñµÃ,²ÎÊý×Ô¶¯´«µÝ.
µ«forward()ÎÞ·¨Öض ......
Ò»¡¢ÎļþÏÂÔؼ°°æ±¾
apache-tomcat-6.0.20.exe
jdk-6u2-windows-i586-p.exe
¶þ¡¢°²×°¼°»·¾³±äÁ¿ÉèÖÃ
Èí¼þ°²×°ºó£¬ÐèÒªÅäÖû·¾³±äÁ¿¡£Ð½¨JAVA_HOME, CATALINA_HOME, classpath,ÐÞ¸Äpath£º
classpath = ".;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\lib\servlet-api.jar"
path += ";%JAVA_ ......
ÔÎĵØÖ·£ºhttp://hi.baidu.com/wangking/blog/item/8a109423ff3d2341ac34dec9.html
ÔÚJava web¿ª·¢Öг£»áʹÓõ½¹¦ÄÜÇ¿´óµÄ¹ýÂËÆ÷£¬Ëû±Ï¾¹ÄܸøÎÒÃÇ´øÀ´ºÜ´óµÄ·½±ã£¬µ«ÊÇÕë¶Ô¹ýÂ˵Ä×ÊÔ´ÎÒÃÇÐèÒªÏêϸµÄÁ˽âËûÃÇÔÚweb.xmlÖеÄÅäÖÃÐÅÏ¢¡£Õâ¸ö¸ù¾Ý¼¸ÖÖ³£ÓõIJ»Í¬Çé¿ö½øÐÐÁË×ܽ᣺
1¡£Èç¹ûÒªÓ³Éä¹ýÂËÓ¦ÓóÌÐòÖÐËùÓÐ×ÊÔ´£º
< ......