??xml version="1.0" encoding="utf-8" standalone="yes"?>国产伦精品一区二区三区精品视频 ,久久精品日产第一区二区,肉色丝袜一区二区http://www.aygfsteel.com/xan/category/30690.htmlwatch and learnzh-cnWed, 07 May 2008 18:10:00 GMTWed, 07 May 2008 18:10:00 GMT60Tomcat 5.5 server.xml 配置的一些问?/title><link>http://www.aygfsteel.com/xan/archive/2008/05/07/198933.html</link><dc:creator>xan</dc:creator><author>xan</author><pubDate>Wed, 07 May 2008 05:02:00 GMT</pubDate><guid>http://www.aygfsteel.com/xan/archive/2008/05/07/198933.html</guid><wfw:comment>http://www.aygfsteel.com/xan/comments/198933.html</wfw:comment><comments>http://www.aygfsteel.com/xan/archive/2008/05/07/198933.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xan/comments/commentRss/198933.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xan/services/trackbacks/198933.html</trackback:ping><description><![CDATA[<ul> <li><strong>Host Name:</strong> </li> </ul> Network name of this virtual host, as registered in your <em>Domain Name Service</em> server. <br /> Exactly one of the Hosts associated with each Engine MUST have a name matching the <code>defaultHost</code> attribute of that Engine.<br /> <br /> <ul> <li><strong>Host Name Alias:</strong></li> </ul> in some circumstances, it is desireable that two or more network names should resolve to the <strong>same</strong> virtual host.<br /> <Host name="www.mycompany.com" ...><br />     ...<br />     <Alias>mycompany.com</Alias> <br />     ...<br /> </Host> <br /> In order for this strategy to be effective, all of the network names involved must be registered <br /> <ul> <li><strong>host appBase: </strong></li> </ul> The <em>Application Base</em> directory for this virtual host. This is the pathname of a directory that may contain web applications to be deployed on this virtual host. <br /> You may specify an absolute pathname for this directory, or a pathname that is relative to the <code>$CATALINA_BASE</code> directory.<br /> <strong>appBase="webapps" </strong>is the default value.<br /> <br /> <ul> <li><strong>host context: </strong></li> </ul> <strong> </strong>You can nest one or more <a >Context</a> elements inside this <strong>Host</strong> element, each representing a different web application associated with this virtual host.<br /> <br /> <ul> <li><strong>context docBase:</strong></li> </ul> The <em>Document Base</em> (also known as the <em>Context Root</em>) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the <code>appBase</code> directory of the owning <a >Host</a>.<br /> <em>If a symbolic link is used for docBase then changes to the symbolic link will only be effective after a Tomcat restart or by undeploying and redeploying the conext. A context reload is not sufficient.<br /> </em><strong>Do not</strong> choose a docBase that starts with your Host's appBase string. The default appBase is "webapps" so do not choose a docBase like "webapps-foo." Doing so will lead to deployment errors: see <a >Bugzilla</a> for details.<br /> The value of this field <strong>must not be set</strong> when the Context is configured using a <code>META-INF/context.xml</code> file as it will be inferred by the automatic deployment process.<br /> <br /> <ul> <li><strong>context path:</strong></li> </ul> The <em>context path</em> of this web application, which is matched against the beginning of each request URI to select the appropriate web application for processing. <br /> All of the context paths within a particular <a >Host</a> <strong>must be unique</strong>. If you specify a context path of an empty string (<strong><span style="color: red;">""</span></strong>), you are defining the <em>default</em> web application for this Host, which will process all requests not assigned to other Contexts.<br /> <strong><span style="color: #2708ff;"></span></strong><span style="font-family: Arial;"><span style="font-family: Verdana;"><span style="font-family: Courier;"><span style="font-family: Impact;"><span style="font-family: Arial;"><span style="font-size: 10pt;"><br /> <br /> <strong>问题</strong>Q?Z么我可以使用http://www.mysite.com:8080/ 去访问Test Project,  而?/span></span></span></span></span></span><span style="font-family: Arial;"><span style="font-family: Verdana;"><span style="font-family: Courier;"><span style="font-family: Impact;"><span style="font-family: Arial;"><span style="font-size: 10pt;">http://localhost:8080/</span></span></span></span></span></span> <span style="font-size: 10pt;">却不能,需使用http://localhost:8080/Test_Project讉K<br /> <br /> C:\WINDOWS\system32\drivers\etc\hosts<br /> 127.0.0.1       localhost<br /> 127.0.0.1        www.mysite.com<br /> <br /> q个问题?#8220;直接使用</span><a href="http://localhost/">http://localhost</a> ?http://www.mysite.com/ <span style="font-size: 10pt;">讉K开发的目</span>” <span style="font-size: 10pt;">Q?Z辑ֈq一目的Q有以下途径Q?br /> <strong>途径1Q?/strong><br /> </span><span style="font-size: 10pt;">     讄 context path=“” Q如<br /> </span><span style="font-size: 10pt;"><Context docBase="Test Project" path="" reloadable="true" crossContext="true" source="org.eclipse.jst.j2ee.server:Test Project"/></Host><br /> <strong><span style="color: #0817ff;">但是q有一个问?/span></strong>Q?br /> 使用eclipse servers 新徏一个serverQ生配|文?</span><span style="font-size: 10pt;">D:\WorkSpace\MY_DEV\Servers\Tomcat v5.5 Server @localhost-config\server.xml,</span><span style="font-size: 10pt;"> <strong>修改</strong>该自动生成的文g<br /> 启动server后,q些配置文g被发布到tomcat webapps的同U目录conf下,而且在发布时server.xml的内容ؓeclipse<strong>自动生成的内?/strong>Q?strong>用户的修改被抛弃</strong>。所以ؓ了达?/span><span style="font-size: 10pt;">“直接使用</span><a href="http://localhost/">http://localhost</a> ?http://www.mysite.com/ <span style="font-size: 10pt;">讉K开发的目</span>” <span style="font-size: 10pt;">q一目标Q有两种ҎQ?/span><span style="font-size: 10pt;"><br /> Ҏ一Q?<br />     直接修改tomcat conf目录下的server.xml文g?br /> <br /> Ҏ二:<br />     在eclipse中,在自动生成的server.xml基础上添加一个host<br />    <span style="font-size: 10pt;"><span style="font-size: 10pt;"> </span><Host appBase="webapps" autoDeploy="true" name="www.mysite.com" unpackWARs="true"><br />         <Context docBase="Test Project" path="" reloadable="true" source="org.eclipse.jst.j2ee.server:</span></span><span style="font-size: 10pt;"><span style="font-size: 10pt;">Test Project</span></span><span style="font-size: 10pt;"><span style="font-size: 10pt;">"/><br />     </Host><br /> 该修改在"关闭Q再启动"(<strong>直接重启不行</strong>)server后,能被更新到tomcat conf下面的server.xml<strong><br /> 在项目发布中Q最l生效的是tomcat conf下的server.xml<br /> </strong></span></span><span style="font-size: 10pt;"><br /> </span><span style="font-size: 10pt;"> <br /> <strong>途径2Q来?/strong></span>http://blog.csdn.net/miqi770/archive/2008/02/20/2109805.aspxQ?span style="font-size: 10pt;">未尝?/span><span style="font-size: 10pt;"></span> <h1><a ></a></h1> <span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 10pt;"><span style="font-size: 8pt;"><span style="font-size: 10pt;">使用</span>eclipse<span style="font-size: 10pt;">发布xm到tomcat</span><br />  <span style="font-size: 10pt;"><span style="font-size: 10pt;">把ROOT目录删掉,把xm重命名ROOT<br />  使用<a href="http://localhost/">http://localhost</a>Ӟ可以直接讉K自己开发的目</span></span></span></span></span></span><br /> <span style="font-size: 10pt;"><br /> </span> <img src ="http://www.aygfsteel.com/xan/aggbug/198933.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xan/" target="_blank">xan</a> 2008-05-07 13:02 <a href="http://www.aygfsteel.com/xan/archive/2008/05/07/198933.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JAVA开发者应该去?0个英文网站【{转?/title><link>http://www.aygfsteel.com/xan/archive/2008/04/24/195498.html</link><dc:creator>xan</dc:creator><author>xan</author><pubDate>Thu, 24 Apr 2008 04:07:00 GMT</pubDate><guid>http://www.aygfsteel.com/xan/archive/2008/04/24/195498.html</guid><wfw:comment>http://www.aygfsteel.com/xan/comments/195498.html</wfw:comment><comments>http://www.aygfsteel.com/xan/archive/2008/04/24/195498.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xan/comments/commentRss/195498.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xan/services/trackbacks/195498.html</trackback:ping><description><![CDATA[http://www.javaalmanac.com - Java开发者年鉴一书的在线版本. 要想快速查到某UJava技巧的用法及示例代? q是一个不错的d.<br /> http://www.onjava.com - O‘Reilly的Java|站. 每周都有新文?<br /> http://java.sun.com - 官方的Java开发者网?- 每周都有新文章发?<br /> http://www.developer.com/java - 由Gamelan.com l护的Java技术文章网?<br /> http://www.java.net - Sun公司l护的一个JavaC֌|站.<br /> http://www.builder.com - Cnet的Builder.com|站 - 所有的技术文? 以JavaZ.<br /> http://www.ibm.com/developerworks/java - IBM的Developerworks技术网? q是其中的Java技术主?<br /> http://www.javaworld.com - 最早的一个Java站点. 每周更新Java技术文?<br /> http://www.devx.com/java - DevXl护的一个Java技术文章网?<br /> http://www.fawcette.com/javapro - JavaPro在线杂志|站.<br /> http://www.sys-con.com/java - Java Developers Journal的在U杂志网?<br /> http://www.javadesktop.org - 位于Java.net的一个Java桌面技术社区网?<br /> http://www.theserverside.com - q是一个讨论所有Java服务器端技术的|站.<br /> http://www.jars.com - 提供Java评论服务. 包括各种framework和应用程?<br /> http://www.jguru.com - 一个非常棒的采用Q&A形式的Java技术资源社?<br /> http://www.javaranch.com - 一个论?得到Java问题{案的地?初学者的好去?<br /> http://www.ibiblio.org/javafaq/javafaq.html - comp.lang.java的FAQ站点 - 攉了来自comp.lang.java新闻l的问题和答案的分类目录.<br /> http://java.sun.com/docs/books/tutorial/ - 来自SUN公司的官方Java指南 - 对于了解几乎所有的java技术特性非常有帮助.<br /> http://www.javablogs.com - 互联|上最z跃的一个Java Blog|站.<br /> http://java.about.com/ - 来自About.com的Java新闻和技术文章网? <br /> <br /> <br /> 原文Q?<br /> <h1><a id="viewpost1_TitleUrl" href="../../Xejuny/archive/2008/04/23/195125.html">JAVA开发者应该去?0个英文网站【{?/a></h1> <img src ="http://www.aygfsteel.com/xan/aggbug/195498.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xan/" target="_blank">xan</a> 2008-04-24 12:07 <a href="http://www.aygfsteel.com/xan/archive/2008/04/24/195498.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java reflectionhttp://www.aygfsteel.com/xan/archive/2008/04/15/193209.htmlxanxanTue, 15 Apr 2008 12:58:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/15/193209.htmlhttp://www.aygfsteel.com/xan/comments/193209.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/15/193209.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/193209.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/193209.htmlJava Reflection (JAVA反射) ----转蝲 讲述reflect基本概念



xan 2008-04-15 20:58 发表评论
]]>
zz J2SE5中的注释http://www.aygfsteel.com/xan/archive/2008/04/15/192959.htmlxanxanMon, 14 Apr 2008 16:38:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/15/192959.htmlhttp://www.aygfsteel.com/xan/comments/192959.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/15/192959.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/192959.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/192959.html阅读全文

xan 2008-04-15 00:38 发表评论
]]>
U有成员能被子类l承?/title><link>http://www.aygfsteel.com/xan/archive/2008/04/15/192957.html</link><dc:creator>xan</dc:creator><author>xan</author><pubDate>Mon, 14 Apr 2008 16:28:00 GMT</pubDate><guid>http://www.aygfsteel.com/xan/archive/2008/04/15/192957.html</guid><wfw:comment>http://www.aygfsteel.com/xan/comments/192957.html</wfw:comment><comments>http://www.aygfsteel.com/xan/archive/2008/04/15/192957.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xan/comments/commentRss/192957.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xan/services/trackbacks/192957.html</trackback:ping><description><![CDATA[<font style="background-color: #c7edcc;"><a href="http://www.aygfsteel.com/sitinspring/archive/2007/12/04/165288.html">http://www.aygfsteel.com/sitinspring/archive/2007/12/04/165288.html</a> <br /> <span style="color: red;">父类的Q何成员变量都是会被子cȝ承下ȝ private,public,protected和承没有关p?他们Ҏ员函数和变量的限制只是在成员的可见性上</span><br /> <br /> <font style="background-color: #c7edcc;"><a href="http://www.aygfsteel.com/ChenGen/archive/2006/09/29/72773.html">http://www.aygfsteel.com/ChenGen/archive/2006/09/29/72773.html</a></font> <br /> 此文中讨Z<a class="postTitle2" id="viewpost1_TitleUrl" href="http://www.aygfsteel.com/ChenGen/archive/2006/09/29/72773.html">JAVAcȝ承过E中其成员的一些问?/a>Q其中包?span style="color: red;">子类隐藏父类同名变量</span>的问题?br /> <br /> <font style="background-color: #c7edcc;"><a href="http://www.aygfsteel.com/shisanfeng/articles/191375.html">http://www.aygfsteel.com/shisanfeng/articles/191375.html</a></font> <br /> 此文中讨Zjaval承中的一些基本概念,没有讨论到存储区域相关的问题<br /> </font><br /> <img src ="http://www.aygfsteel.com/xan/aggbug/192957.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xan/" target="_blank">xan</a> 2008-04-15 00:28 <a href="http://www.aygfsteel.com/xan/archive/2008/04/15/192957.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>while(i!=i){}http://www.aygfsteel.com/xan/archive/2008/04/15/192951.htmlxanxanMon, 14 Apr 2008 16:03:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/15/192951.htmlhttp://www.aygfsteel.com/xan/comments/192951.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/15/192951.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/192951.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/192951.html定义为:double i=Double.NaN ?i!=i 恒ؓtrueQ死循环



xan 2008-04-15 00:03 发表评论
]]>
multi-thread: volatile(zz from javaEye)http://www.aygfsteel.com/xan/archive/2008/04/10/191714.htmlxanxanWed, 09 Apr 2008 16:26:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/10/191714.htmlhttp://www.aygfsteel.com/xan/comments/191714.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/10/191714.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/191714.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/191714.html volatile, 用更低的代h替代同步

Z么用volatile比同步代h?
同步的代? 主要由其覆盖范围军_, 如果可以降低同步的覆盖范? 则可以大q提升程序性能. 

而volatile的覆盖范围仅仅变量别的. 因此它的同步代h很低.

volatile原理是什?
volatile的语? 其实是告诉处理器, 不要我攑օ工作内存, L接在d操作?(工作内存详见java内存模型)

因此, 当多核或多线E在讉K该变量时, 都将直接操作d, q从本质? 做到了变量共?

volatile的有什么优?
1, 更大的程序吞吐量
2, 更少的代码实现多U程
3, E序的׾~性较?br /> 4, 比较好理? 无需太高的学习成?br />
volatile有什么劣?
1, Ҏ出问?br /> 2, 比较难设?br />


volatileq算存在脏数据问?br />
volatile仅仅能保证变量可见? 无法保证原子?

volatile的race conditionCZ:

public class TestRaceCondition {
    private volatile int i = 0;
   
    public void increase() {
       i++;
    }

    public int getValue() {
       return i;
    }
}

当多U程执行increaseҎ? 是否能保证它的g是线性递增的呢?
{案是否定的.

原因:
q里的increaseҎ, 执行的操作是i++, ?i = i + 1;
针对i = i + 1, 在多U程中的q算, 本n需要改变i的?
如果, 在i已从内存中取到最新? 但未?q行q算, 此时其他U程已数ơ将q算l果赋值给i.
则当前线E结束时, 之前的数ơ运结果都被覆盖.

? 执行100ơincrease, 可能l果?< 100.
一般来? q种情况需要较高的压力与ƈ发情况下, 才会出现.

如何避免q种情况?
解决以上问题的方?
一U是 操作? 加上同步.
q种Ҏ, 无疑大大降低程序性能, 且违背了volatile的初?

W二U方式是, 使用g原语(CAS), 实现非阻塞算?br /> 从CPU原语?  支持变量U别的低开销同步.



CPU原语-比较q交?CompareAndSet),实现非阻塞算?br />
什么是CAS?
cas是现代CPU提供lƈ发程序用的原语操作. 不同的CPU有不同的使用规范.

?Intel 处理器中Q比较ƈ交换通过指o?cmpxchg pd实现?br style="color: #ffffff;" /> PowerPC 处理器有一对名?#8220;加蝲q保?#8221;?#8220;条g存储”的指令,它们实现相同的目圎ͼ
MIPS ?PowerPC 处理器相|除了W一个指令称?#8220;加蝲链接”?br />
CAS 操作包含三个操作?—?内存位置QVQ、预期原|AQ和新?B)

什么是非阻塞算?
一个线E的p|或挂起不应该影响其他U程的失败或挂v.q类法UC为非d(nonblocking)法

Ҏd法:
如果有一cdƈ发操? 其中一个线E优先得到对象监视器的锁, 当其他线E到辑֐步边界时, ׃被阻?
直到前一个线E释放掉锁后, 才可以l竞争对象锁.(当然,q里的竞争也可是公^? 按先来后到的ơ序)

CAS 原理:

我认Z|?V 应该包含?AQ如果包含该|则将 B 攑ֈq个位置Q否则,不要更改该位|,只告诉我q个位置现在的值即可?br style="color: #ffffff;" />
CAS使用CZ(jdk 1.5 q发?AtomicIntegercd?)

    /**
     * Atomically sets to the given value and returns the old value.
     *
     * @param newValue the new value
     * @return the previous value
     */
    public final int getAndSet(int newValue) {
        for (;;) {
            int current = get();
            if (compareAndSet(current, newValue))
                return current;
        }
    }

    public final boolean compareAndSet(int expect, int update) {
        return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
    }

q个Ҏ? AtomicIntegercȝ常用Ҏ, 作用? 变量设|ؓ指定? q返回设|前的?
它利用了cpu原语compareAndSet来保障值的唯一?

? AtomicIntegercM, 其他的实用方? 也是Z同样的实现方?
比如 getAndIncrement, getAndDecrement, getAndAdd{等.

CAS语义上存在的"ABA 问题"

什么是ABA问题?
假设, W一ơ读取V地址的A? 然后通过CAS来判断V地址的值是否仍旧ؓA, 如果? 将B的值写入V地址,覆盖A?

但是, 语义? 有一个漏z? 当第一ơ读取V的A? 此时, 内存V的值变为B? 然后在未执行CAS? 又变回了A?
此时, CAS再执行时, 会判断其正确? q进行赋?

q种判断值的方式来断定内存是否被修改q? 针对某些问题, 是不适用?

Z解决q种问题, jdk 1.5q发包提供了AtomicStampedReference(有标记的原子引用)c? 通过控制变量值的版本来保证CAS正确?

其实, 大部分通过值的变化来CAS, 已经够用?




jdk1.5原子包介l?Zvolatile)

包的特色:
1, 普通原子数值类型AtomicInteger, AtomicLong提供一些原子操作的加减q算.

2, 使用了解册数据问题的经典模?"比对后设?, ?查看d中数据是否与预期提供的g?如果一?才更?

3, 使用AtomicReference可以实现Ҏ有对象的原子引用及赋?包括Double与Float,
但不包括对其的计?点的计?只能依靠同步关键字或Lock接口来实C.

4, Ҏl元素里的对?W合以上特点? 也可采用原子操作.包里提供了一些数l原子操作类
AtomicIntegerArray, AtomicLongArray{等.

5, 大幅度提升系l吞吐量及性能.

具体使用, 详解java doc.

xan 2008-04-10 00:26 发表评论
]]>
[ant] ant初试http://www.aygfsteel.com/xan/archive/2008/04/09/191703.htmlxanxanWed, 09 Apr 2008 14:50:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/09/191703.htmlhttp://www.aygfsteel.com/xan/comments/191703.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/09/191703.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/191703.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/191703.html部分参考网友内?Ҏ作谢!

当一个代码项目大了以后,每次重新~译Q打包,试{都会变得非常复杂而且重复Q因此c语言中有make脚本来帮助这些工作的扚w完成。在Java 中应用是q_无关性的Q当然不会用q_相关的make脚本来完成这些批处理d了,ANT本n是q样一个流E脚本引擎,用于自动化调用程序完成项目的~译Q打包,试{。除了基于JAVA是^台无关的外,脚本的格式是ZXML的,比make脚本来说q要好维护一些?/span>

a simple sample project with ant

http://www.namipan.com/d/SpringWithJDBCandAnt.zip/4057bd9bf48dafa14efe13b73b26e09cd3f71a1ac0433100

xan 2008-04-09 22:50 发表评论
]]>
春天和冬?/title><link>http://www.aygfsteel.com/xan/archive/2008/04/09/191702.html</link><dc:creator>xan</dc:creator><author>xan</author><pubDate>Wed, 09 Apr 2008 14:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/xan/archive/2008/04/09/191702.html</guid><wfw:comment>http://www.aygfsteel.com/xan/comments/191702.html</wfw:comment><comments>http://www.aygfsteel.com/xan/archive/2008/04/09/191702.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xan/comments/commentRss/191702.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xan/services/trackbacks/191702.html</trackback:ping><description><![CDATA[prospring 里的例子,版权他有<br /> <a target="_blank">http://www.namipan.com/d/HibernateWithSpring.zip/00db8a5746523a4081dc333ad34dddb0d4e30710bb950000</a><br /> <br /> 可以直接run,也可以用build.xml, 只要Ҏd的配|文件的路径卛_, ?"..\conf\applicationContext.xml" 之类?<br /> <br /> applicationContext.xml 是关? 在里面要配置几个重要的bean<br />     <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close"><br />     <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"><br />     <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"><br /> <br /> 配置sessionFactory?注意以下东西, 也就是要注意实际使用的hibernate的版?我用的是spring1.1, 它里面lib\hibernate下有个hibernate2.jar,而且下面q个Ҏ需要hibernate2 net.sf.hibernate支持 <span style="color: rgb(51,102,255); font-style: italic">org.springframework.orm.hibernate.support.HibernateDaoSupport.getHibernateTemplate()<br /> </span><span style="color: black">因而偶猜测spring1.1只支持hibernate2,故而方a选择是下面的第一个了</span><span style="color: rgb(51,102,255); font-style: italic"><br /> </span>    <prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop><br />     <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop><br /> mysql不支持主键sequence,Ҏidentity<br /> <br /> 例外值得x的是hibernate的mapping配置中的one-to-many. 其实q好了~<br /> <br /> 数据库脚本和相关配置文g参见对应目录. 数据库徏表手动搞?..<br /> <br /> 注意要加入对应的spring对hibernate支持的包<br /> <img src ="http://www.aygfsteel.com/xan/aggbug/191702.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xan/" target="_blank">xan</a> 2008-04-09 22:49 <a href="http://www.aygfsteel.com/xan/archive/2008/04/09/191702.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>无意识无限递归http://www.aygfsteel.com/xan/archive/2008/04/09/191700.htmlxanxanWed, 09 Apr 2008 14:47:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/09/191700.htmlhttp://www.aygfsteel.com/xan/comments/191700.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/09/191700.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/191700.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/191700.html     public String toString(){
       return "InfiniteRecursion"+this+"\n";
    }
   
    public static void main(String[] args){
       ArrayList al=new ArrayList();
       al.add(new InfiniteRecursion());
       System.out.println(al);
    }
}

问题在于String的自动类型{换,return "InfiniteRecursion"+this+"\n"   ~译器见String后跟着一?#8216;+’Q?#8216;+’之后的不是StringQ于是编译器试?span style="color: rgb(0,0,255)">this转换为StringQ将调用InfiniteRecursion的toString()ҎQ从而造成递归?br />
             zz thinking in JAVA


xan 2008-04-09 22:47 发表评论
]]>
Code Linkshttp://www.aygfsteel.com/xan/archive/2008/04/09/191694.htmlxanxanWed, 09 Apr 2008 14:40:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/09/191694.htmlhttp://www.aygfsteel.com/xan/comments/191694.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/09/191694.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/191694.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/191694.htmlspring+jdbc
pro spring上的一个例?原例比较?分块介绍,q里整合?eclipse 下java project,  代码中有关键部分的注?
http://www.namipan.com/d/SpringWithJDBC.zip/af150784ec5c40cdfb26b82e2fc990c9676206cfe3540000

File upload & download
源码也是别h?出处忘了,sry.   原来是用myeclipse,我没有这个插?不过相当没关p?只要重新建工E?再机械的^V好? 
代码的分?待添?..)

遇到的问? web project 的包N?直接在configpath里添加了...晕菜...),D出现服务器启动时无法扑ֈActionServlet错误(不过代码~译时是没有错误? -----q个错误很低U?不过我虽然知道应该加到web-info的lib?但是不是特别清楚configpath和lib的区?或者说我猜C, 却希望能从其他h那里得到印证.
http://www.namipan.com/d/FileUploadDownload.zip/f60b9d9ad299a491d2794ca6e83739e2f9652c1f47b01500


验证码图?/span>
|上看到?比较?随机生成背景(不复?,随机生成数字,数字嵌入背?/span>
http://www.namipan.com/d/ValidatePic.zip/63a3d84ef622464994779e761808728ce5f64e342d170000

原代码中一个比较有价值的问题:
使用上述代码时会抛出一个异常:getOutputStream() has already been called for this response
tomcat5下jsp出现getOutputStream() has already been called for this response异常的原因和解决Ҏ

在tomcat5下jsp中出现此错误一般都是在jsp中用了输出(如输出图片验证码Q文件下载等Q,
没有妥善处理好的原因?
具体的原因就?
在tomcat中jsp~译成servlet之后在函数_jspService(HttpServletRequest request, HttpServletResponse response)的最?
有一D这L代码
finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
q里是在释放在jsp中用的对象Q会调用response.getWriter(),因ؓq个Ҏ是和
response.getOutputStream()相冲H的Q所以会出现以上q个异常?

然后当然是要提出解决的办法,其实挺简单的Qƈ不是和某些朋友说的那?-
jsp内的所有空格和回RW号所有都删除掉)Q?

在用完输出以后调用以下两行代码即可:
out.clear();
out = pageContext.pushBody();


xan 2008-04-09 22:40 发表评论
]]>
[Java Parameter] Java中参C递是传D是传址 (收藏里不能添加摘?..)http://www.aygfsteel.com/xan/archive/2008/04/09/191691.htmlxanxanWed, 09 Apr 2008 14:34:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/09/191691.htmlhttp://www.aygfsteel.com/xan/comments/191691.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/09/191691.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/191691.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/191691.html(...对于cȝ实例而言Q这份拷贝恰巧是实例引用的拷贝,它(参数Q指向的实例地址和原实例引用指向的地址都是一LQ因此对参数的修Ҏ时也会媄响到实例本nQ故此造成了Java传递类是是传递的引用卛_址的假象,如下面例子中的changeMemberField函数Q但是我们把参数指向的地址改到别的实例上时Q如changeMember函数Q我们会发现参数和原实例引用再也不会发生关系?..)
http://www.aygfsteel.com/sitinspring/archive/2008/01/16/175677.html

xan 2008-04-09 22:34 发表评论
]]>
[Eclipse] Eclipse 颜色讄http://www.aygfsteel.com/xan/archive/2008/04/09/191688.htmlxanxanWed, 09 Apr 2008 14:25:00 GMThttp://www.aygfsteel.com/xan/archive/2008/04/09/191688.htmlhttp://www.aygfsteel.com/xan/comments/191688.htmlhttp://www.aygfsteel.com/xan/archive/2008/04/09/191688.html#Feedback0http://www.aygfsteel.com/xan/comments/commentRss/191688.htmlhttp://www.aygfsteel.com/xan/services/trackbacks/191688.htmlEclipse颜色配置
http://duanni.javaeye.com/blog/175517 

xan 2008-04-09 22:25 发表评论
]]>
վ֩ģ壺 ܱ| տ| | | ƽ| ӯ| | | | ƽ| | ͭ| | | | | ̨| ɶ| | | | | ׶| ɽ| ɽ| Ϫ| Ԫ| | | ׼| | | ԭ| пѷ| | | | »| ԭ| ̨| |