½âÎöXMLʱDTDµÄ´¦Àí ½âÎöʱºöÂÔ£¬Éú³ÉXMLÎļþʱ¼ÓÉÏ
Ò»¡¢½âÎöXMLÎļþʱ£¬Óöµ½DTDµÄ¶¨ÒåÒªÔõô°ì£¿
ÏÂÃæÕâ¶Î´úÂëÊÇibatisÅäÖÃÎļþ£¬ÓÃw3c Dom(ÆäʵÈÎÒâÒ»ÖÖ½âÎö·½Ê½¶¼ÊÇÕâÑù)¶¼»á´Óhttp://www.ibatis.com/dtd/sql-map-config-2.dtd
Õâ
¸öµØÖ·ÕÒ¶ÔÓ¦µÄDTDÎļþ½øÐÐУÑ飬Èç¹ûÒòÌØÍøÉÏÕâ¸öµØÖ·²»´æÔڵĻ°£¬¾Í»á±¨ java.net.ConnectException:
Connection timed out: connect ¡£
Xml´úÂë
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<
sqlMapConfig
>
<
settings
useStatementNamespaces
=
"true"
/>
<!--·ÀÖ¹¿ÕSqlMap±¨´í by zhangbo start -->
<
sqlMap
resource
=
"ibatis/project/project-blank.xml"
/>
<
sqlMap
resource
=
"ibatis/project/user-mapping.xml"
/>
</
sqlMapConfig
>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<settings useStatementNamespaces="true"/>
<!--·ÀÖ¹¿ÕSqlMap±¨´í by zhangbo start -->
<sqlMap resource="ibatis/project/project-blank.xml"/>
<sqlMap resource="ibatis/project/user-mapping.xml"/>
</sqlMapConfig>
Óöµ½ÕâÖÖÎÊÌâ¿ÉÒÔÓÐÁ½ÖÖ½âÎö·½Ê½£¬µÚÒ»°ÑDTDÏÂÔصı¾µØ£¬Ö¸¶¨´Ó±¾µØ¼ÓÔØDTDÎļþ£»ÁíÒ»ÖÖ£¬¸É´àºöÂÔDTDÎļþ¡£
ÕâÁ½ÖÖ·½Ê½¶¼ÊÇÒÔÖØй¹½¨ÊµÌåµÄ½âÎöÆ÷(EntityResolver)Ϊ»ù´¡½â¾ö·½°¸µÄ£¬ÖØй¹½¨ÊµÌå½âÎöÆ÷¶ø²»ÊÇʹÓÃĬÈϵÄʵÌå½âÎöÆ÷£¬ÒòΪĬ
ÈϵĽâÎöÆ÷»á¸ù¾Ýʵ¼ÊµÄurl½øÐжÁÈ¡£¬ÏÂÃæÊÇÒ»¶ÎÈçºÎÀ´½âÎöÉÏÃæÌáµ½µÄÅäÖÃÎļþ£¬Á½ÖÖ·½Ê½¶¼Óбê×¢
Java´úÂë
public
&nbs
Ïà¹ØÎĵµ£º
ÄãÖªµÀXMLÎļþ°É£¿£¨²»ÖªµÀµÄGOOGLEÈ¥£¡£©ÄÇÄãÌý˵¹ýÔÚXMLÀïÊéдSQLÓï¾äÂ𣿻»¾ä»°Ëµ£¬°ÑÄãµÄÏîÄ¿ÀïËùÓÐSQLÓï¾ä´æ´¢ÔÚXMLÎļþÀÄãÌý˵¹ýÂð£¿Äã×ö¹ýÂð£¿
ÎÒÍ·´ÎÌý˵ÊÇС°¬¸æËßÎҵģ¬ÎҸҿ϶¨ËûÊǸöÕâ·½ÃæµÄ¸ßÊÖ£¬ºÇºÇ£¨ÔÞÒ»¸ö£¬µ½´ËΪֹ£¡£©
ÄǸøÄãչʾһÏ£¬ÔÚXMLÀïÊéдSQLÓï¾ä°É
<commands>
<comman ......
web.xmlÎļþ¶ÔÓÚÅäÖÃÈκÎJava WebÓ¦Óö¼±ØÐèµÄ¡£
£¨1£©ÅäÖÃStrutsµÄActionServlet
<servlet><!--ÔªËØÀ´ÉùÃ÷ActionServlet-->
<servlet-name><!--ÔªËØ£ºÓÃÀ´¶¨ÒåServletµÄÃû³Æ-->
<servlet-class><!--ÔªËØ:ÓÃÀ´Ö¸¶¨ServletµÄÍêÕûÀàÃû-->
<servlet>
<servlet-name& ......
XML ºÍ JSON Êǵ±½ñ³£ÓõÄÁ½ÖÖÊý¾ÝÃèÊöÓë´«ÊäµÄ¸ñʽ£¬ÌرðÊÇÉæ¼°µ½ JS ʱʹÓà JSON ÆÄΪƵ·±¡£×ÔÈ»£¬ÔÚ Java µÄÊÀ½çÀïÉÙ²»ÁËÍê³É JavaBean ÓëÕâÁ½ÖÖ¸ñʽÏ໥ת»»µÄ×é¼þ£¬ÄǾÍÊÇ XStream ºÍ JSON-lib¡£ÕâÀïÎÒ¼òµ¥¼ÇÏ XStream µÄÓ÷¨¡£
ÆäʵÏàÀàËƵŤ¾ßÔçÒÑÓÐÖ®¡£Èç¹ûÓùý DWR µÄͬ־£¬Ò»¶¨ÓÐÓ¡Ïñ£¬DWR ½øÐÐÔ¶ ......
×î³£¼ûµÄXMLÊý¾ÝÀàÐÍÓУºElement, Attribute£¬Comment, Text.
Element, Ö¸ÐÎÈç<Name>Tom<Name>µÄ½Úµã¡£Ëü¿ÉÒÔ°üÀ¨£ºElement, Text, Comment, ProcessingInstruction, CDATA, and EntityReference.
Attribute, Ö¸ÔÚ<Employee >Ö ......