JSPÖÐÉú³É¶¯Ì¬XMLʵÀý
<?xml version="1.0" encoding="gb2312" ?>
<?xml-stylesheet type="tet/css" href="mystyle.css" ?>
<%@ page errorPage="error.jap" %>
<%@ page contentType="text/xml" %>
<realmarid>
»ÊÂí»¨Ãû²á
<athlete>
<name>Æë´ïÄÚ</name>
<country>·¨¹ú</country>
<age>32</age>
<telephone>124252432</telephone>
<date>The date is <%=new java.util.Date()%></date>
</athlete>
<athlete>
<name>ÀͶû</name>
<country>Î÷°àÑÀ</country>
<age>28</age>
<telephone>1243432</telephone>
<date>The date is <%=new java.util.Date()%></date>
</athlete>
<athlete>
<name>±´¿ËººÄ·</name>
<country>Ó¢¹ú</country>
<age>28</age>
<telephone>1243432</telephone>
<date>The date is <%=new java.util.Date()%></date>
</athlete>
</realmarid>
µÚÒ»ÐУºXMLÉùÃ÷£»
µÚ¶þÐУºÎªXMLÎļþµÄÓ¦ÓóÌÐòÌṩÐÅÏ¢£¬Type±íÃ÷ÏÔʾµÄ·½Ê½£¬XML¿ÉÒÔʹÓÃCSSºÍXSLÁ½ÖÖ·½Ê½ÏÔʾ£¬´Ë´¦±êÃ÷ʹÓÃCSSÀ´ÏÔʾ£»
Href±íÃ÷ÁËCSSÎļþµÄÏà¶Ô·¾¶£¬ÕâÀïcssÎļþºÍjspÎļþÔÚͬһ¸öĿ¼Ï£»
½ÓÏÂÀ´ÊÇJSPÖеÄpageÖ¸ÁpageÖ¸ÁîÌṩJSPÒ³ÃæµÄÊôÐÔ£¬pageÖ¸ÁîÖж¨ÒåµÄÊôÐÔÊÊÓÃÓÚ¸ÃJSPÒ³Ãæ£¬ÒÔ¼°ËùÓаüº¬µÄ¾²Ì¬Îļþ£»
pageÖ¸ÁîµÄ¸ñʽ£º<@%page [attribute="value"]%>
contentTypeÊôÐÔ±íÃ÷ÄÚÈÝÀàÐÍÐÅÏ¢£¬´Ë´¦Îªtext/xml£¬´Ë´¦ÊÇJSPÖÐÖ±½ÓÓ¦ÓÃXMLµÄ¹Ø¼üËùÔÚ£»
ÉÏÀýÖÐÓÐ<%=new java.util.Date()%>µÄÓï¾ä£¬ÊÇJSPÖаüº¬µÄJavaÓï¾ä£¬Õⲿ·ÖÉú³É¶¯Ì¬Ò³Ãæ
ÉÏÀýÖÐÔÚXMLÎĵµÄ£°åÖмÓÈëJSPÒ³Ãæ£¬ÔÚJSPÖмÓÈëJava´úÂ룬ÕâÑùXML¾Í¿ÉÒÔÓɾ²±ä¶¯£¬²úÉú¶¯Ì¬µÄÄÚÈÝ£¬Ò³ÃæÒ²¿ÉÒÔ±äµÃÃÀ¹ÛÉú¶¯£»
µ±XMLÎĵµÖеÄJSPÒ³Ãæ±»ÇëÇóʱ£¬Java´úÂ뽫ִÐУ¬JSP·þÎñÆ÷ÏȽ«JSPÍøÒ³±àÒë³ÉServlet£¬±àÒëʱJava´úÂ뽫»á±»Ö´ÐУ¬ÇÒÖ»Ðè·þÎñÆ÷µÚÒ»´ÎÖ´Ðм´¿É£¬¿Í»§¶ËÔÙÇëÇó¸ÃÒ³ÃæÊ±£¬»á½«µÚÒ»´ÎÖ´ÐеĽá¹û´«Ë͸ø¿Í»§¶Ë£¬´Ó¶ø´ó´óÌá¸ßÖ´ÐÐЧÂÊ¡£
Ïà¹ØÎĵµ£º
Jsp ÒÔUrl·½Ê½´«²ÎÊýÂÒÂëÎÊÌâ
±ÈÈç˵ xxxx.action?name="ÖÐÎÄ"
´«µ½Action »á·¢Éú ÂÒÂë
½â¾ö·½·¨1£ºÒª¸Ätomcat µÄ±àÂë
2£º
Òª¸Ä³ÉÕâ¸ö·½Ê½¿ÉÒÔ½â¾öÂÒÂ룺
xxxx.action?name=encodeURIComponent("ÖÐÎÄ"); ......
¾³£¿´µ½Ðí¶àÈËÎÊÈçºÎÅäÖÃJDKºÍJSP£¬ÏÖÔÚÎÒ°Ñ·½·¨×ܽáÏ£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
µÚÒ»²½£ºÏÂÔØjdkºÍtomcat
µÚ¶þ²½£º°²×°ºÍÅäÖÃÄãµÄjdkºÍtomcat£ºÖ´ÐÐjdkºÍtomcatµÄ°²×°³ÌÐò£¬È»ºóÉèÖð´ÕÕ·¾¶½øÐа²×°¼´¿É¡£
1.°²×°j2sdkÒÔºó£¬ÐèÒªÅäÖÃһϻ·¾³±äÁ¿£¬ÔÚÎҵĵçÄÔ->ÊôÐÔ->¸ß¼¶->»·¾³±äÁ¿->ϵͳ±äÁ¿ÖÐÌí¼ÓÒÔÏ»· ......
XMLÎĵµ·Ö¸î³ÉС¿é
µ±ÄãÒª°ÑXMLÎĵµ·Ö¸î³ÉС¿éʱ£¬ÄãÒª¶ÁÈ¡ÊäÈëÎĵµ£¬´´½¨Êä³öÎĵµºÍת»»×ÓÎĵµ¡£²»¹ÜÊÇÔÚC++»¹ÊÇFOALÖеĽű¾ÖУ¬CMarkup¶¼Ê¹Ëü±äµÃ¼òµ¥¡£¶ÔÓںܴóµÄXMLÎĵµ£¬ÔÚÌáÈ¡×ÓÎĵµÊÇʹÓÃCMarkup¶ÁÈ¡Îļþģʽ¾Í¿ÉÓúÜÉÙµÄÄÚ´æ¶ÁÈ¡Ëü¡£
¹Ø¼üÎÊÌâÊÇ£¬µ±Äã·Ö¸îXMLÎĵµÊ±ÄãÏëÔÚÄǸöµØ·½·Ö¸î£¿¿ÉÒÔÊÇÒ»¸öºÏºõ ......
Ò»Ö±ÒÔÀ´¶ÁÈ¡xml¶¼ÊÇͨ¹ýDataSetµÄReadXML·½·¨À´½â¾ö£¬ÆäËûÊôÐÔÒ²¶¼Ã»ÓÐʹÓá£ÔÚÊý¾ÝÁ¿Ð¡µÄʱºòµ¹Ò²Ïà°²ÎÞÊ£¬Ö±µ½½ñÌì¶Áȡһ¸ö20MµÄXMLÁ÷²Å·¢ÏÖʵÔÚ̫ӰÏìЧÂÊÁË¡£
ĬÈÏÇé¿öÏ£¬ReadXMLȱʡÇé¿öÏÂʹÓÃXmlReadMode.Auto·½Ê½¶ÁÈ¡£¬ÓÃÒÔǰµÄ×÷·¨£¬ÓÉÓÚxmlÎļþÀïûÓаüº¬Scheme,DataSet»áÏÈÍÆ¶ÏxmlµÄ½á¹¹£¬È»ºóÔÙ¼ÓÔØÊý¾Ý¡£¿É ......
JSP ÄÚÖöÔÏó ÊÕ²Ø
ÄÚÖöÔÏóÊDz»ÐèÒªÉùÃ÷£¬Ö±½Ó¿ÉÒÔÔÚJSPÖÐʹÓõĶÔÏó£¬JSPÓÐÒÔϼ¸ÖÖÄÚÖöÔÏó£º
1.request¶ÔÏó
request±íʾHttpServletRequest¶ÔÏó¡£Ëü°üº¬ÁËÓйØä¯ÀÀÆ÷ÇëÇóµÄÐÅÏ¢£¬²¢ÇÒÌṩÁ˼¸¸öÓÃÓÚ»ñÈ¡cookie, header, ºÍsessionÊý¾ÝµÄÓÐÓõķ½·¨¡£¿Í»§¶ËµÄÇëÇóÐÅÏ¢±»·â×°ÔÚrequest¶ÔÏóÖУ¬Í¨¹ýËü²ÅÄÜÁ˽⵽¿Í»§ ......