<?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>
<!-- ÅäÖúÍÓÅ»¯SQL Map½âÎöʵÀýµÄÉ趨 -->
<settings cacheModelsEnabled="true" //SQL MapÔËÐÐʱʵÀýµÄ»º´æModelÊÇ·ñ¿ªÆô
enhancementEnabled="true" //È«¾ÖÐÔµÄÆôÓûò½ûÓÃ×Ö½ÚÂëÔöÇ¿£¬ÒÔÓÅ»¯·ÃÎÊPOJO±äÁ¿ÊôÐԵŦÄÜ
lazyLoadingEnabled="true" //³Ö¾Ã»¯Êý¾ÝÊÇ·ñÑÓ³Ù¼ÓÔØ
maxRequests="32" //ͬʱִÐÐsqlÓï¾äµÄ×î´óÐÐÊý
maxSessions="10" //ͬһʱ¼äÄڻµÄ×î´óSessionÊý¡£ËùνµÄSession¾ÍÊÇÒ»¸öÇëÇó»òÒ»¸öSQL MapÔËÐÐʱʵÀý×Ô¶¯»ñµÃµÄ»á»°
maxTransactions="5" //Öƶ¨ÁË×î´óÊÂÎñ´¦ÀíµÄÏß³ÌÊý
useStatementNamespaces="true" />//Öƶ¨ÁËÔÚSQL MapÓ³ÉäÎļþÖÐÊÇ·ñÓÃÈ«ÏÞ¶¨ÃûÀ´ÒýÓÃÓ³ÉäÉùÃ÷
<!-- Åä ......
<?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>
<!-- ÅäÖúÍÓÅ»¯SQL Map½âÎöʵÀýµÄÉ趨 -->
<settings cacheModelsEnabled="true" //SQL MapÔËÐÐʱʵÀýµÄ»º´æModelÊÇ·ñ¿ªÆô
enhancementEnabled="true" //È«¾ÖÐÔµÄÆôÓûò½ûÓÃ×Ö½ÚÂëÔöÇ¿£¬ÒÔÓÅ»¯·ÃÎÊPOJO±äÁ¿ÊôÐԵŦÄÜ
lazyLoadingEnabled="true" //³Ö¾Ã»¯Êý¾ÝÊÇ·ñÑÓ³Ù¼ÓÔØ
maxRequests="32" //ͬʱִÐÐsqlÓï¾äµÄ×î´óÐÐÊý
maxSessions="10" //ͬһʱ¼äÄڻµÄ×î´óSessionÊý¡£ËùνµÄSession¾ÍÊÇÒ»¸öÇëÇó»òÒ»¸öSQL MapÔËÐÐʱʵÀý×Ô¶¯»ñµÃµÄ»á»°
maxTransactions="5" //Öƶ¨ÁË×î´óÊÂÎñ´¦ÀíµÄÏß³ÌÊý
useStatementNamespaces="true" />//Öƶ¨ÁËÔÚSQL MapÓ³ÉäÎļþÖÐÊÇ·ñÓÃÈ«ÏÞ¶¨ÃûÀ´ÒýÓÃÓ³ÉäÉùÃ÷
<!-- Åä ......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="fw_student">
<resultMap class="com.sias.Student" id="student">
<result column="name" property="name" jdbcType="VARCHAR2"/>
<result column="sex" property="sex" jdbcType="VARCHAR2"/>
</resultMap>
<select id="Select" resultMap="student">//±»SqlMapClientÀàµÄList queryForList(String)·½·¨µ÷ÓÃ
select name,sex from fw_student
</select>
<insert id="insert" parameterClass="com.sias.Student">//±»SqlMapClientÀàµÄ void insert(String,Object)·½·¨µ÷ÓÃ
insert into fw_student(name,sex) values(#name:VARCHAR2#,#sex:VARCHAR2#)
</insert>
<update id="update" parameterClass="java.util.Map">//±»SqlMapClientÀàµÄ void update(String,Map)·½·¨µ÷ÓÃ
update fw_student cm set name='chang'
<isPropertyAvailable property="n">//Èç¹ûMap.put(String,value)Öдæ ......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="fw_student">
<resultMap class="com.sias.Student" id="student">
<result column="name" property="name" jdbcType="VARCHAR2"/>
<result column="sex" property="sex" jdbcType="VARCHAR2"/>
</resultMap>
<select id="Select" resultMap="student">//±»SqlMapClientÀàµÄList queryForList(String)·½·¨µ÷ÓÃ
select name,sex from fw_student
</select>
<insert id="insert" parameterClass="com.sias.Student">//±»SqlMapClientÀàµÄ void insert(String,Object)·½·¨µ÷ÓÃ
insert into fw_student(name,sex) values(#name:VARCHAR2#,#sex:VARCHAR2#)
</insert>
<update id="update" parameterClass="java.util.Map">//±»SqlMapClientÀàµÄ void update(String,Map)·½·¨µ÷ÓÃ
update fw_student cm set name='chang'
<isPropertyAvailable property="n">//Èç¹ûMap.put(String,value)Öдæ ......
declare @xml xml
set @xml = '<root/>'
select @xml
declare @value varchar(10)
set @value = 'val1'
set @xml.modify('insert <item value="{sql:variable("@value")}" /> into (/root)[1]')
select @xml
set @value = 'val2'
set @xml.modify('replace value of (/root/item/@value)[1] with "val2"')
select @xml
set @value = 'val3'
set @xml.modify('replace value of (/root/item/@value)[1] with sql:variable("@value")')
select @xml ......
declare @xml xml
set @xml = '<root/>'
select @xml
declare @value varchar(10)
set @value = 'val1'
set @xml.modify('insert <item value="{sql:variable("@value")}" /> into (/root)[1]')
select @xml
set @value = 'val2'
set @xml.modify('replace value of (/root/item/@value)[1] with "val2"')
select @xml
set @value = 'val3'
set @xml.modify('replace value of (/root/item/@value)[1] with sql:variable("@value")')
select @xml ......
1¡¢µ¼³öµ½XMl select * from Brand for xml auto ,root('Brands')
<Brands>
<Brand BrandID="E584596D-4D66-4F2F-B6F7-71C3BEB4CA21" Name="inganico" />
<Brand BrandID="19B04451-DDC4-4CDF-BE30-CB4E703B27DA" Name="°²¸¶´ï" />
<Brand BrandID="3C6C8E12-7C4A-4F19-B491-4C0A64A48303" Name="°²ÖÇ" />
<Brand BrandID="BF6C361A-8993-4660-A89D-EB32CCC9CE49" Name="°Ù¸»" />
<Brand BrandID="8E7FE420-3AE3-4017-80AB-B53CA29C80CA" Name="º£²©Í¨" />
<Brand BrandID="505C5565-08C5-4EF5-9316-55CA76C1E9F3" Name="»Ý¶û·á" />
<Brand BrandID="E5BA2A72-B1D1-457A-9AFD-A9D9B336E7C0" Name="ÀûÆÕÃÅ" />
<Brand BrandID="1982A195-5263-45CC-B872-96F3C145FCCD" Name="ÁªµÏ" />
<Brand BrandID="E460CDA6-4A83-4C62-B049-3B980516AD79" Name="Èð°Ø" />
<Brand BrandID="06BACF99-BB7E-447C-B021-CD8C3FFAE85A" Name="Èø»ùÄ·" />
<Brand BrandID="165510D9-342D-4402-882D-0A00DBFDAAE3" Name="Ð ......
1¡¢µ¼³öµ½XMl select * from Brand for xml auto ,root('Brands')
<Brands>
<Brand BrandID="E584596D-4D66-4F2F-B6F7-71C3BEB4CA21" Name="inganico" />
<Brand BrandID="19B04451-DDC4-4CDF-BE30-CB4E703B27DA" Name="°²¸¶´ï" />
<Brand BrandID="3C6C8E12-7C4A-4F19-B491-4C0A64A48303" Name="°²ÖÇ" />
<Brand BrandID="BF6C361A-8993-4660-A89D-EB32CCC9CE49" Name="°Ù¸»" />
<Brand BrandID="8E7FE420-3AE3-4017-80AB-B53CA29C80CA" Name="º£²©Í¨" />
<Brand BrandID="505C5565-08C5-4EF5-9316-55CA76C1E9F3" Name="»Ý¶û·á" />
<Brand BrandID="E5BA2A72-B1D1-457A-9AFD-A9D9B336E7C0" Name="ÀûÆÕÃÅ" />
<Brand BrandID="1982A195-5263-45CC-B872-96F3C145FCCD" Name="ÁªµÏ" />
<Brand BrandID="E460CDA6-4A83-4C62-B049-3B980516AD79" Name="Èð°Ø" />
<Brand BrandID="06BACF99-BB7E-447C-B021-CD8C3FFAE85A" Name="Èø»ùÄ·" />
<Brand BrandID="165510D9-342D-4402-882D-0A00DBFDAAE3" Name="Ð ......
1.½âÊÍ
ÒòΪjspÓõ½ÁËSiteDataÀ࣬¶øSiteData¼Ì³ÐBasePageÀ࣬
ËùÒÔBasePage¹¹Ô캯Êý
BasePage¹¹Ô캯Êý
initializeByCityCodeº¯Êýmain
keyµÄÖµmain.UpImages
vµÄÖµmain.UpImages
2.Ö´ÐÐÍê BasePage.java
ÖеÄinitCommon()ºó£¬
Ìøµ½SiteData.java ÖÐµÄ process();·½·¨£¬
public SiteData(HttpServletRequest request,
ServletContext context, HttpServletResponse response,
JspWriter out)
{
super(request, context, response, out);
process();//¡¾×¢Òâ´Ë·½·¨±»×ÓÀàoverrieds ¡¿
}
3. process();´¦ÀíÍê±Ïºó£¬×ªµ½AjaxSiteData.javaÖÐ
public AjaxSiteData(HttpServletRequest request,
ServletContext context, HttpServletResponse response,
JspWriter out)
{
super(request, context, response, out);
normalhttp = false;
}
Ö´ÐÐÍênormalhttp = false; ......
1.½âÊÍ
ÒòΪjspÓõ½ÁËSiteDataÀ࣬¶øSiteData¼Ì³ÐBasePageÀ࣬
ËùÒÔBasePage¹¹Ô캯Êý
BasePage¹¹Ô캯Êý
initializeByCityCodeº¯Êýmain
keyµÄÖµmain.UpImages
vµÄÖµmain.UpImages
2.Ö´ÐÐÍê BasePage.java
ÖеÄinitCommon()ºó£¬
Ìøµ½SiteData.java ÖÐµÄ process();·½·¨£¬
public SiteData(HttpServletRequest request,
ServletContext context, HttpServletResponse response,
JspWriter out)
{
super(request, context, response, out);
process();//¡¾×¢Òâ´Ë·½·¨±»×ÓÀàoverrieds ¡¿
}
3. process();´¦ÀíÍê±Ïºó£¬×ªµ½AjaxSiteData.javaÖÐ
public AjaxSiteData(HttpServletRequest request,
ServletContext context, HttpServletResponse response,
JspWriter out)
{
super(request, context, response, out);
normalhttp = false;
}
Ö´ÐÐÍênormalhttp = false; ......
½âÎö_Net¿ò¼ÜϵÄXML±à³Ì¼¼Êõ
Ò»£®Ç°ÑÔ£º
XMLÊÇ΢Èí.NetÕ½ÂÔµÄÒ»¸öÖØÒª×é³É²¿·Ö£¬¶øÇÒËü¿ÉνÊÇXML Web·þÎñµÄ»ùʯ£¬ËùÒÔÕÆÎÕ.Net¿ò¼ÜϵÄXML¼¼Êõ×ÔÈ»ÏԵ÷dz£ÖØÒªÁË¡£±¾ÎĽ«Ö¸µ¼´ó¼ÒÈçºÎÔËÓÃC#ÓïÑÔÍê³É.Net¿ò¼ÜϵÄXMLÎĵµµÄ¶Áд²Ù×÷¡£Ê×ÏÈ£¬ÎÒ»áÏò´ó¼Ò½éÉÜ.Net¿ò¼ÜÖÐÓëXMLÏà¹ØµÄÃüÃû¿Õ¼äºÍÆäÖеÄÖØÒªÀà¡£Æä´Î£¬ÎÒ»¹»á¸ø³öÓйصÄʵÀýÒÔʹ¶ÁÕ߸ü½øÒ»²½µÄÁ˽âXMLÎĵµµÄ¶Áд²Ù×÷µÄ¾ßÌå·½·¨¡£
¶þ£®XMLÃüÃû¿Õ¼äºÍÏà¹ØÀà¼ò½é£º
ÔÚÉîÈë½øÐÐ.Net¿ò¼ÜϵÄXMLÎĵµµÄ²Ù×÷֮ǰ£¬ÎÒÏëºÜÓбØÒªÏò´ó¼Ò½éÉÜ.Net¿ò¼ÜÖÐÓëXML¼¼ÊõÓйصÄÃüÃû¿Õ¼äºÍÆäÖÐһЩÖØÒªµÄÀà¡£.Net¿ò¼ÜΪÎÒÃÇÌṩÁËÒÔÏÂһЩÃüÃû¿Õ¼ä£ºSystem.Xml¡¢System.Xml.Schema¡¢System.Xml.Serialization¡¢System.Xml.XpathÒÔ¼° System.Xml.XslÀ´°üÈݺÍXML²Ù×÷Ïà¹ØµÄÀà¡£
- System.XmlÃüÃû¿Õ¼ä°üº¬ÁËһЩ×îÖØÒªµÄXMLÀ࣬ÆäÖÐ×îÖ÷ÒªµÄÀàÊǺÍXMLÎĵµµÄ¶Áд²Ù×÷Ïà¹ØµÄÀà¡£ÕâЩÀàÖаüÀ¨4¸öÓë¶ÁÏà¹ØµÄÀàÒÔ¼°2¸öÓëдÏà¹ØµÄÀà¡£ËüÃÇ·Ö±ðÊÇ£ºXmlReader¡¢XmlTextReader¡¢XmlValidatingReader¡¢XmlNodeReader¡¢XmlWriterÒÔ¼° XmlTextWrit ......