??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品高清国产麻豆专区,亚洲沟沟美女亚洲沟沟,亚洲性猛交xx乱http://m.tkk7.com/windforce/category/15610.htmlzh-cnFri, 08 Jun 2007 00:55:58 GMTFri, 08 Jun 2007 00:55:58 GMT60Java的中文编E与配置心得[转蝲]http://m.tkk7.com/windforce/archive/2007/06/07/122517.html风之?/dc:creator>风之?/author>Thu, 07 Jun 2007 02:18:00 GMThttp://m.tkk7.com/windforce/archive/2007/06/07/122517.htmlhttp://m.tkk7.com/windforce/comments/122517.htmlhttp://m.tkk7.com/windforce/archive/2007/06/07/122517.html#Feedback0http://m.tkk7.com/windforce/comments/commentRss/122517.htmlhttp://m.tkk7.com/windforce/services/trackbacks/122517.htmlJava的中文问题历史悠久,q不绝Q至今也没有完全解决Q但是上有政{下有对{,我们L有办法搞定它的。跟Java相关的中文问题主要有两类Q一cL~程的问题,涉及到I/OQ内码{换等。第二类是Javaq行环境的配|,涉及字体Q属性配|等。我刚刚用了一天的旉解决q些问题Q觉得很有必要给自己写个备忘录之cȝ?

我看q是从问题入手吧Q这样不致于让大家打瞌睡。我惛_个程序,q个E序有个基本功能是昄文g内容Q我用JTextArea来做昄的事情,E序单的到家了,但是是中文都是q。我的配|是JBuilder7QJBuilder自带的JDK1.3.3_b24Q我自己装的JDK是JDK1.4.0_02_b02Q都是主的JDK。操作系l是英文Windows2000加中文支持包?

我尝试换JDKQ?.3.3?.4.0都不行,down一个最新的j2sdk-1_4_1-rc也是不行Q好像不是JDK的问题,于是我就把精力集中到I/O的编码{换上Q我查阅了网上若q关于JAVA中文问题的文章,把编码{换搞的倍儿清楚Q可是怎么试,换什么编码折N不行Q反而显C的更糟p,当初q是q有些规矩Q就是象在纯英文pȝ上显C的那样Q好Ҏq知道那是汉字,只是昄不出来,{我折腾~码Q就变得都是问号了。唉Q郁P

~码转换心得Q?

JAVA内部是UNICODE~码Q在I/O时如果用Reader/Writerp发生~码转换Q用系l属性file.encoding作ؓ~码方式。如果用Stream没有{换的事情了,那是Binary的数据?

有用的方法有Q?。在Reader/Writer上加encoding的选项Q注意编码的方向Q在Reader中的encoding表示把数据从encoding转换成UnicodeQwriter是把Unicode的字W{换成encoding格式的?。用String.getByte()把字W串转换成指定编码?

常用的编码格式:ISO8859_1Q这个是英文pȝ~省?bit~码Q因为是8bit的,所以不会把汉字的高位删去,所以用它也是可以处理汉字的Q我自己q么理解Q总觉得有些不妥,但又不知道不妥在何处Q还望高人指出)。GB2312和GBKQ汉字编码,推荐使用GBKQ它兼容GB2312q且支持更多汉字。UNICODEQ一个大的字W集Q不知是不是国际标准反正大家都支持,使用16位对每个字符~码Q汉字虽然正合适,但英文却吃亏了,要用多一倍的I间来存储,所以很多hq是老大不乐意,写的E序不支持UNICODE?

JSP/Servlet的中文问题有两种解决办法Q?。不在程序中q行~码转换Q把q个工作交给览器,Ҏ是用javac –encoding GBK *.java来编译所有的beanQ然后在JSP面上加

<%@ page contentType="text/html;charset=gb2312" %>

或者是在HTML中直接加Q?

到底加那个,试试q道了Q我也搞不清楚了?

2。在E序中指定编码,用javac –encoding ISO8859_1 *.java来编译所有的beanQ在涉及C文显C的E序上加

str=new String(str.getBytes("ISO8859_1"));

上面两种Ҏ不能LQ意思就是要么就是GBKQ要么就是ISO8859_1Q从里到外都一样就好了?

数据库JDBC的中文问题,一般只要按照数据库指定的编码进行{换,比如按照ISO8859_1读,ISO8859_1写,一般就没什么问题了?

虽然有这些编码上的心得,但是q不能解x的问题。看来我的程序输入输出用的都是ISO8859_1Q我的问题跟~码没什么关pR是不是字体的问题呢Q在Swing的组件中Q字体L那么几个Q基本上是定ȝQ选那个都不行。但是我H然发现可以更改q些字体的配|,是font.properties q个文gQ一般JDK都带了中文的字体配置文gQ可能是font.properties.zh之类的,不同版本的JDK名字有些差别Q你要做的就是用中文的配|覆盖font.properties文g。我满心Ƣ喜的以为成功了Q但是失败无情的又一ơ打M我。不是这U方法不对,但是在Windowspȝ中,java能够比较自动的检查你的系l编码,使用最合适的字体配置文gQ一般不需要你改动了,在JDK1.2之前实是要q么改的Q难怪那文章是JDK1.1的文档呢?

qfont.properties也不灵了Q唉Q是不是JBuilder有问题呀Q到了这儿,我不得不怀疑它了,虽然它从没让我失望过Q我xJBuilderQ拿起JDK命o行,哎呀Q可q中文竟然出来了!直是.....莫名其妙呀Q因为JBuilder也是用的q个JDK呀Q没理由呀Q我再次打开JBuilderQ运行,qQ怪事.......我来看看.....我把JBuilder里面的执行命令拷贝到DOSH口里手动执?...没有中文.....怪怪怪,我仔l对照我手敲的命令和JBuilder拷出来的命oQ除了我用的是java它用的是javaw之外Q别的几乎都一PN.......q个java和javaw竟然会不一P

?......要我说什么呢Q答案就是这个了Qjavaw会用与java不同的Local配置q行工作Q导致了我一直看不到中文Q而java是好好的。JBuilder也是好好的,没有问题Q调用javaw也不是它的错Q难道你xơ运行或者调试的时候蹦ZDOS黑框么?呵呵。这是JDK的一个BugQ我在java的网站上查到q个bugQ描q的情况跟我的一P然后Sun说这个Bug已经修复了,嘿嘿Q简直就是扯淡!修复个茄子!Bug~号是:4629351。不信可以去看看?

但是N我就不能在JBuilder里面看我可爱的中文了吗?好像JBuilder5的时候还能选择是用javaq是javawQ现在好像没法儿选了。怎么才能让javaw支持中文呢?l过又是一番苦苦查找,竟然没有什么结果,郁闷Q正当苦闷之ӞH然惌v当初配置qUNIX下的TOMCATQ好像加了些启动参数Q就能让tomcat支持中文了,赶快d以前的文,啊,q好我当初写了工作心得,要不然又抓瞎了。其实道理很单,是lJAVA虚拟机加上一些属性:

-Dfile.encoding=GBK -Ddefault.client.encoding=GBK -Duser.language=zh -Duser.region=CN

把它跟在javaw的命令行后面当参敎ͼ哈哈Q搞定!

在JBuilder中选择Project->Project Properties->run->edit->VM ParametersQ填上就行了Q?

配置心得Q?

在JDK低版本和UNIX下,需要改动font.propertiesQ让JAVA VM能够扑ֈ合适的字体来显C汉字?

目前为止Qjavaw有BugQ只使用英文的LocalQ需要给VM加上属性才行正常显CZ文?br />文章出处Q?a >Java?www.javajia.com)



]]>
郁闷的~~c3p0q接池配|?/title><link>http://m.tkk7.com/windforce/archive/2007/04/20/112202.html</link><dc:creator>风之?/dc:creator><author>风之?/author><pubDate>Fri, 20 Apr 2007 06:49:00 GMT</pubDate><guid>http://m.tkk7.com/windforce/archive/2007/04/20/112202.html</guid><wfw:comment>http://m.tkk7.com/windforce/comments/112202.html</wfw:comment><comments>http://m.tkk7.com/windforce/archive/2007/04/20/112202.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/windforce/comments/commentRss/112202.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/windforce/services/trackbacks/112202.html</trackback:ping><description><![CDATA[正常配置Q?br /><bean id="dataSource"<br />  class="com.mchange.v2.c3p0.ComboPooledDataSource"<br />  destroy-method="close"><br />  <property name="driverClass"><br />   <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value><br />  </property><br />  <property name="jdbcUrl"><br />   <value>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=xxx</value><br />  </property><br />  <property name="user"><br />   <value>xxx</value><br />  </property><br />  <property name="password"><br />   <value>xxx</value><br />  </property><br /> </bean><br />使用IDE格式化后Q变?br /><bean id="dataSource"<br />  class="com.mchange.v2.c3p0.ComboPooledDataSource"<br />  destroy-method="close"><br />  <property name="driverClass"><br />   <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value><br />  </property><br />  <property name="jdbcUrl"><br /><font color="#ff3300">   <value><br />      jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=xxx<br />   </value><br /></font>  </property><br />  <property name="user"><br />   <value>xxx</value><br />  </property><br />  <property name="password"><br />   <value>xxx</value><br />  </property><br /> </bean><br />死zM不认得了Q我狂晕?...<br /><br /><img src ="http://m.tkk7.com/windforce/aggbug/112202.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/windforce/" target="_blank">风之?/a> 2007-04-20 14:49 <a href="http://m.tkk7.com/windforce/archive/2007/04/20/112202.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>spring下lob数据处理【原创?/title><link>http://m.tkk7.com/windforce/archive/2006/11/08/79880.html</link><dc:creator>风之?/dc:creator><author>风之?/author><pubDate>Wed, 08 Nov 2006 08:20:00 GMT</pubDate><guid>http://m.tkk7.com/windforce/archive/2006/11/08/79880.html</guid><wfw:comment>http://m.tkk7.com/windforce/comments/79880.html</wfw:comment><comments>http://m.tkk7.com/windforce/archive/2006/11/08/79880.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/windforce/comments/commentRss/79880.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/windforce/services/trackbacks/79880.html</trackback:ping><description><![CDATA[ <p> <font size="1">做了个简单的通告理Q在本机试时数据量比较。最开始用的时varchar2?000Q之后用hibernate中的textcdQ对应数据库中的Clobcd。当数据量小?000Ӟ可以直接使用setObject()插入数据库。当数据量大?000时。报错:socket write error?br />查找了一些资料,说当数据量超q?000Ӟ应该使用方式操作。看到头昏昏Q烦都烦M......<br />最后发现Spring装了对lob数据的操作,可以直接使用jdbcTemple操作lob数据?br />当用MySql、MSSQL、Oracle 10gӞ使用DefaultLobHandlerQ用Oracle 9i时用OracleLobHandler?br />CZ代码Q【{值javaWorld?br /></font> </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <font size="1"> <span style="COLOR: #008080"> 1</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> File binaryFile </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> File(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">c:\\workspace\\wish.jpg</span><span style="COLOR: #000000">"</span></font> <font size="1"> <span style="COLOR: #000000">);<br /></span> <span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> File txtFile </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> File(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">c:\\workspace\\test.txt</span><span style="COLOR: #000000">"</span></font> <font size="1"> <span style="COLOR: #000000">);<br /></span> <span style="COLOR: #008080"> 3</span> </font> <font size="1"> <span style="COLOR: #000000">       <br /></span> <span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> InputStream is </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span></font> <font size="1"> <span style="COLOR: #000000"> FileInputStream(binaryFile);<br /></span> <span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> Reader reader </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span></font> <font size="1"> <span style="COLOR: #000000"> FileReader(txtFile);<br /></span> <span style="COLOR: #008080"> 6</span> </font> <font size="1"> <span style="COLOR: #000000">       <br /></span> <span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000">        JdbcTemplate jdbcTemplate </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span></font> <font size="1"> <span style="COLOR: #000000"> JdbcTemplate(dataSource);<br /></span> <span style="COLOR: #008080"> 8</span> </font> <font size="1"> <span style="COLOR: #000000">       <br /></span> <span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> LobHandler lobHandler </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span></font> <font size="1"> <span style="COLOR: #000000"> DefaultLobHandler();<br /></span> <span style="COLOR: #008080">10</span> </font> <font size="1"> <span style="COLOR: #000000">       <br /></span> <span style="COLOR: #008080">11</span> <span style="COLOR: #000000">        jdbcTemplate.execute(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">INSERT INTO test (txt, image) VALUES(?, ?)</span><span style="COLOR: #000000">"</span></font> <font size="1"> <span style="COLOR: #000000">,<br /></span> <span style="COLOR: #008080">12</span> <span style="COLOR: #000000">                     </span><span style="COLOR: #0000ff">new</span></font> <font size="1"> <span style="COLOR: #000000"> AbstractLobCreatingPreparedStatementCallback(lobHandler) {<br /></span> <span style="COLOR: #008080">13</span> <span style="COLOR: #000000">                        </span><span style="COLOR: #0000ff">protected</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span></font> <font size="1"> <span style="COLOR: #000000"> setValues(PreparedStatement pstmt, LobCreator lobCreator)<br /></span> <span style="COLOR: #008080">14</span> <span style="COLOR: #000000">                                                           </span><span style="COLOR: #0000ff">throws</span></font> <font size="1"> <span style="COLOR: #000000"> SQLException, DataAccessException {<br /></span> <span style="COLOR: #008080">15</span> <span style="COLOR: #000000">                            lobCreator.setClobAsCharacterStream(pstmt, </span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">, reader, (</span><span style="COLOR: #0000ff">int</span></font> <font size="1"> <span style="COLOR: #000000">) txtFile.length());<br /></span> <span style="COLOR: #008080">16</span> <span style="COLOR: #000000">                            lobCreator.setBlobAsBinaryStream(pstmt, </span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">, is, (</span><span style="COLOR: #0000ff">int</span></font> <font size="1"> <span style="COLOR: #000000">) binaryFile.length());<br /></span> <span style="COLOR: #008080">17</span> </font> <font size="1"> <span style="COLOR: #000000">                        }<br /></span> <span style="COLOR: #008080">18</span> </font> <font size="1"> <span style="COLOR: #000000">                     });<br /></span> <span style="COLOR: #008080">19</span> </font> <font size="1"> <span style="COLOR: #000000">       <br /></span> <span style="COLOR: #008080">20</span> </font> <font size="1"> <span style="COLOR: #000000">        reader.close();<br /></span> <span style="COLOR: #008080">21</span> </font> <font size="1"> <span style="COLOR: #000000">        is.close();<br /></span> <span style="COLOR: #008080">22</span> <span style="COLOR: #000000"></span></font> </div> <p> <font size="1">d代码Q?br /><br /></font> </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <font size="1"> <span style="COLOR: #008080"> 1</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> Writer writer </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> FileWriter(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">c:\\workspace\\test_bak.txt</span><span style="COLOR: #000000">"</span></font> <font size="1"> <span style="COLOR: #000000">);<br /></span> <span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">final</span><span style="COLOR: #000000"> OutputStream os </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> FileOutputStream(</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> File(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">c:\\workspace\\wish_bak.jpg</span><span style="COLOR: #000000">"</span></font> <font size="1"> <span style="COLOR: #000000">));<br /></span> <span style="COLOR: #008080"> 3</span> </font> <font size="1"> <span style="COLOR: #000000">       <br /></span> <span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000">        jdbcTemplate.query(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">SELECT txt,image FROM test WHERE id = ?</span><span style="COLOR: #000000">"</span></font> <font size="1"> <span style="COLOR: #000000">,<br /></span> <span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Object[] {</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> Integer(</span><span style="COLOR: #000000">1</span></font> <font size="1"> <span style="COLOR: #000000">)},<br /></span> <span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">                </span><span style="COLOR: #0000ff">new</span></font> <font size="1"> <span style="COLOR: #000000"> AbstractLobStreamingResultSetExtractor() {<br /></span> <span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000">                    </span><span style="COLOR: #0000ff">protected</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> streamData(ResultSet rs) </span><span style="COLOR: #0000ff">throws</span></font> <font size="1"> <span style="COLOR: #000000"> SQLException, IOException, DataAccessException {<br /></span> <span style="COLOR: #008080"> 8</span> <span style="COLOR: #000000">                        FileCopyUtils.copy(lobHandler.getClobAsCharacterStream(rs, </span><span style="COLOR: #000000">1</span></font> <font size="1"> <span style="COLOR: #000000">), writer);<br /></span> <span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">                        FileCopyUtils.copy(lobHandler.getBlobAsBinaryStream(rs, </span><span style="COLOR: #000000">2</span></font> <font size="1"> <span style="COLOR: #000000">), os);<br /></span> <span style="COLOR: #008080">10</span> </font> <font size="1"> <span style="COLOR: #000000">                    }<br /></span> <span style="COLOR: #008080">11</span> </font> <font size="1"> <span style="COLOR: #000000">                 });<br /></span> <span style="COLOR: #008080">12</span> </font> <font size="1"> <span style="COLOR: #000000">        writer.close();<br /></span> <span style="COLOR: #008080">13</span> </font> <font size="1"> <span style="COLOR: #000000">        os.close();<br /></span> <span style="COLOR: #008080">14</span> </font> <span style="COLOR: #000000"> <br /> </span> <font size="1"> <span style="COLOR: #008080">15</span> <span style="COLOR: #000000"></span></font> </div> <font size="1">备注1QOracleLobHandler要求注入CommonsDbcpNativeJdbcExtractorQ否则报错:要求使用OracleConnectionQ不可以使用Dbcpq接池?br /></font> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <font size="1"> <span style="COLOR: #008080">1</span> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">bean id</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">lobHandler</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">org.springframework.jdbc.support.lob.OracleLobHandler</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> </font> <span style="COLOR: #000000"> <br /> </span> <font size="1"> <span style="COLOR: #008080">2</span> <span style="COLOR: #000000"> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">property name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">nativeJdbcExtractor</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> </font> <span style="COLOR: #000000"> <br /> </span> <font size="1"> <span style="COLOR: #008080">3</span> <span style="COLOR: #000000"> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />       </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">bean </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/></span> </font> <span style="COLOR: #000000"> <br /> </span> <font size="1"> <span style="COLOR: #008080">4</span> <span style="COLOR: #000000"> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />   </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">property</span> <span style="COLOR: #000000">></span> </font> <span style="COLOR: #000000"> <br /> </span> <font size="1"> <span style="COLOR: #008080">5</span> <span style="COLOR: #000000"> <img src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />   </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">bean</span> <span style="COLOR: #000000">></span> </font> </div> <font size="1">备注2QOracle驱动版本很多Q要求用正的驱动。当驱动版本错误?报错Q无法释放LobHandlerQ无法关闭WriterQ无法从套接字读取更多的信息。执行插入操作,但是Clobcd数据为空?/font> <img src ="http://m.tkk7.com/windforce/aggbug/79880.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/windforce/" target="_blank">风之?/a> 2006-11-08 16:20 <a href="http://m.tkk7.com/windforce/archive/2006/11/08/79880.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在JDK1.4中用JAXP1.3[转蝲]http://m.tkk7.com/windforce/archive/2006/09/28/72675.html风之?/dc:creator>风之?/author>Thu, 28 Sep 2006 13:03:00 GMThttp://m.tkk7.com/windforce/archive/2006/09/28/72675.htmlhttp://m.tkk7.com/windforce/comments/72675.htmlhttp://m.tkk7.com/windforce/archive/2006/09/28/72675.html#Feedback0http://m.tkk7.com/windforce/comments/commentRss/72675.htmlhttp://m.tkk7.com/windforce/services/trackbacks/72675.html在JDK1.4中用JAXP1.3
׃JDK1.5以上已经自带jaxp了,而jdk1.4以下版本需要自己添加jaxp库文件?/div>
 
1。下?/div>
因ؓjwsdp-1.5中带的jaxp?.26版本Q因此需要单独重C载jaxp
 
参考:
 
2.安装:
JAXP_RI_20041025.class所在的目录?q入命o行,
q行Qjava -cp . JAXP_RI_20041025
然后屏幕上列出所有解压出来的文g名字?/div>
此时Q在当前目录下会有一个叫jaxp-1_3的目录,里面有jaxp的jar文g和api文?/div>
 
3.jaxp需要用到的jar?都在jaxp-1_3目录?Q?/div>
dom.jar,jaxp-api.jar,sax.jar,xalan.jar,xercesImpl.jar
 
4.接下来就可以Ҏ自己需要来使用jaxp1.3?/div>
 
5.׃sun默认使用的解析器是经q其包装后的(ZXerces version 2.6.0 ?XSLTC version 2.5.2),比如Q?/div>
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl(可查看javax.xml.parsers.SAXParserFactory 的源代码),
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl(可查看javax.xml.transform.TransformerFactory 的源代码).
因此在需要用其它解析器的时候,需要通过讄pȝ属性值的方式Q?/div>
或者在$java.home/lib/jaxp.propertiesq行配置($java.home为System.getProperty("java.home")所得到的\径,具体可以查看javax.xml.parsers.FactoryFinder源代码中?static Object find(String factoryId, String fallbackClassName) Ҏ)来选择具体的解析器实现?/div>
jaxp.properties中支持以下属?
 
CZ文g如下(实际是jaxp的默认?Q?/div>
javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
javax.xml.datatype.DatatypeFactory=com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl
 
假如需要用apache的解析器Q那么如下操??/div>
(均ؓ当前最新版?
b.解压获得相应的jar文g,攑օclasspath中?/div>
3.配置jaxp.properties为:
javax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.TransformerFactoryImpl
#也可以?/div>
#javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
javax.xml.datatype.DatatypeFactory=org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl
 
 
 
 
 
6.需要关于jaxp的调试信息,讄pȝ属性jaxp.debug?卛_
   System.setProperty("jaxp.debug","1");
或者运行时的命令ؓQ?java -Djaxp.debug=1 com.lizongbo.TestJAXP
 
 
 
几篇非常好的资料Q?/div>
 
JAXP 专述 Sun ?Java API for XML 语法分析
JAXP 再述 Sun ?Java API for XML ParsingQ?.1 ?/span>
 
JAXP 1.3 的新Ҏ,W?1 部分
技术综qͼ考察解析 API 的变化和新的验证 API
JAXP 1.3 的新Ҏ,W?2 部分
XPath 功能、支持名U空间的工具和其他改q?/span>
JAXP 全面介绍Q第 1 部分
XML 处理工具包解析和验证变得更Ҏ
 
Factory模式和Abstract Factory模式
 
Java中关于XML的API一?/strong>
 
 


Trackback: http://tb.donews.net/TrackBack.aspx?PostId=418679



]]>sendRedirect VS forwordhttp://m.tkk7.com/windforce/archive/2006/09/17/70139.html风之?/dc:creator>风之?/author>Sun, 17 Sep 2006 07:06:00 GMThttp://m.tkk7.com/windforce/archive/2006/09/17/70139.htmlhttp://m.tkk7.com/windforce/comments/70139.htmlhttp://m.tkk7.com/windforce/archive/2006/09/17/70139.html#Feedback0http://m.tkk7.com/windforce/comments/commentRss/70139.htmlhttp://m.tkk7.com/windforce/services/trackbacks/70139.html2.forwardӞ操作完全在服务器端进行,由服务器直接执行新的URL。客L甚至毫不知情?br />3.׃sendRedirect是由客户端自动请求的Q所以客LW一ơ的h数据׃能得C存;相反Q在forward的情况,客户W一ơ的h数据得到了保存,卛_新的URL里能够得到原先的h数据?br />4.在相同的情况下,׃sendRedirect相当于客L两次hQ所以forward的效率较sendRedirect要好?br />5.sendRedirect()一定要在response对象,别的语言的头域输出没有输出正文时才能使用,因ؓ按W3C标准,头域在在输出后是不许改变状态的,只有JSP和SERVLET可以改变?而一但有正文输出,׃产生BUFFERd.

比如\r
<%
out.println("sss");
response.sendRedirect("url");
%>
q是错误?或者在此之前有HTML
<HTMLMWPW>
<%
response.sendRedirect("url");
%>
q了是错误的,因ؓHTML内容也是out对象输出?response对象已经被占?q时应该用forward()才对.


]]>
struts下解决ؕ码一?/title><link>http://m.tkk7.com/windforce/archive/2006/09/13/69323.html</link><dc:creator>风之?/dc:creator><author>风之?/author><pubDate>Wed, 13 Sep 2006 02:51:00 GMT</pubDate><guid>http://m.tkk7.com/windforce/archive/2006/09/13/69323.html</guid><wfw:comment>http://m.tkk7.com/windforce/comments/69323.html</wfw:comment><comments>http://m.tkk7.com/windforce/archive/2006/09/13/69323.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/windforce/comments/commentRss/69323.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/windforce/services/trackbacks/69323.html</trackback:ping><description><![CDATA[新徏一个SetCharacterEncodingServlet的类Q承ActionServletQ?重写process()Ҏ。如下示Q?br />          protected void process(HttpServletRequest request,<br />            HttpServletResponse response) throws java.io.IOException,<br />            javax.servlet.ServletException<br />          {<br />                request.setCharacterEncoding("UTF-8");<br />              super.process(request, response);<br />            }<br />在web.xml中部|ActionServlet?br /><servlet><br />    <servlet-name>action</servlet-name><br />    <servlet-class>com..util.UTF8ActionServlet</servlet-class><br />    <init-param><br />      <param-name>config</param-name><br />      <param-value>/WEB-INF/struts-config.xml</param-value><br />    </init-param><br />     <init-param><br />      <param-name>debug</param-name><br />      <param-value>3</param-value><br />    </init-param><br />    <init-param><br />      <param-name>detail</param-name><br />      <param-value>3</param-value><br />    </init-param><br />    <load-on-startup>0</load-on-startup><br />  </servlet><br /><br />   <servlet-mapping><br />    <servlet-name>action</servlet-name><br />    <url-pattern>*.do</url-pattern><br />   </servlet-mapping><img src ="http://m.tkk7.com/windforce/aggbug/69323.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/windforce/" target="_blank">风之?/a> 2006-09-13 10:51 <a href="http://m.tkk7.com/windforce/archive/2006/09/13/69323.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于commons-fileuploadlg中文q的问?/title><link>http://m.tkk7.com/windforce/archive/2006/09/13/69313.html</link><dc:creator>风之?/dc:creator><author>风之?/author><pubDate>Wed, 13 Sep 2006 02:07:00 GMT</pubDate><guid>http://m.tkk7.com/windforce/archive/2006/09/13/69313.html</guid><wfw:comment>http://m.tkk7.com/windforce/comments/69313.html</wfw:comment><comments>http://m.tkk7.com/windforce/archive/2006/09/13/69313.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/windforce/comments/commentRss/69313.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/windforce/services/trackbacks/69313.html</trackback:ping><description><![CDATA[ <p>    在用commons-fileuploadlgq程中,刚开始出Cؕ码ƈ没有在意。加了一个过滤器Q编码全部UTF-8,OK!q行调试,出来q是qQ我倒!Ҏgb2312Q结果竟然好了,文g名、输出都是中?br />    后来l过再研I过后,发现commons-fileupload的DiskFileUpload有一个setHeadEncoding的方法,在获取文件名的时候是要用到的。如果没有设|,׃用默认的gb2312~码?br />   setHeadEncoding("UTF-8")Q调试一切ok?/p> <img src ="http://m.tkk7.com/windforce/aggbug/69313.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/windforce/" target="_blank">风之?/a> 2006-09-13 10:07 <a href="http://m.tkk7.com/windforce/archive/2006/09/13/69313.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> վ֩ģ壺 <a href="http://770144.com" target="_blank">һػɫƬ</a>| <a href="http://www-554949.com" target="_blank">1000Ƶ</a>| <a href="http://992fanli.com" target="_blank">һ߹ۿ</a>| <a href="http://44168888.com" target="_blank">պav</a>| <a href="http://ruidamo.com" target="_blank">ֻƵ</a>| <a href="http://52099jy.com" target="_blank">avһ߲</a>| <a href="http://shadaiym.com" target="_blank">Դ߹ۿѸ</a>| <a href="http://webgame86.com" target="_blank">һ234 </a>| <a href="http://44g8.com" target="_blank">ƷƵվ</a>| <a href="http://apguangyu.com" target="_blank">޾Ʒsuvһ88</a>| <a href="http://dd99com.com" target="_blank">߹ۿƵվ</a>| <a href="http://eee94.com" target="_blank">ɫַ</a>| <a href="http://yw835.com" target="_blank">ۺ뾫Ʒһ</a>| <a href="http://simupiao.com" target="_blank">aƵ߹ۿ</a>| <a href="http://0967c.com" target="_blank">ҹӰձŷ޾Ʒһ </a>| <a href="http://ettedia.com" target="_blank">޾ƷƷۺ</a>| <a href="http://gisdn.com" target="_blank">պѸһëƬ</a>| <a href="http://tsxyhq.com" target="_blank">˾Ʒþ޸岻 </a>| <a href="http://mosason.com" target="_blank">һѸ</a>| <a href="http://jomashopcn.com" target="_blank">ŷ޾ƷAV</a>| <a href="http://zygwkqf.com" target="_blank">9420ѸƵ</a>| <a href="http://14743592.com" target="_blank">Ļþ</a>| <a href="http://fsrongxing.com" target="_blank">һƬѲŵӰ </a>| <a href="http://sjkuaixun.com" target="_blank">Ļ߹ۿƵ</a>| <a href="http://gepuw.com" target="_blank">a߹ۿ</a>| <a href="http://87fulitv.com" target="_blank">һƬѲ</a>| <a href="http://jsjumei.com" target="_blank">Ůվ߹ۿƵѵ</a>| <a href="http://1877808.com" target="_blank"></a>| <a href="http://67f6.com" target="_blank">Ʒþþþþþ</a>| <a href="http://arkinbokis.com" target="_blank">Ӱ߹ۿ</a>| <a href="http://gz-shunan.com" target="_blank">Ƶվ</a>| <a href="http://xixidhw.com" target="_blank">ҹƵ</a>| <a href="http://gxshenquan.com" target="_blank">þþƷѹƬС</a>| <a href="http://43sihu.com" target="_blank">޳ַ</a>| <a href="http://juytv.com" target="_blank">ִִӲˬƵ</a>| <a href="http://6t23.com" target="_blank">㽶Ѳ</a>| <a href="http://zgbeian.com" target="_blank">ۺavһ </a>| <a href="http://xiamenwave.com" target="_blank">һѹۿƵwww</a>| <a href="http://holdengong.com" target="_blank">Ůƨվ</a>| <a href="http://vvbbn.com" target="_blank">666ƷƷ</a>| <a href="http://nmgqsyg.com" target="_blank">ѲĻ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>