??xml version="1.0" encoding="utf-8" standalone="yes"?>伊人久久亚洲综合,亚洲的天堂av无码,337P日本欧洲亚洲大胆精品http://www.tkk7.com/juhongtao/category/3201.htmlzh-cnWed, 28 Feb 2007 03:39:41 GMTWed, 28 Feb 2007 03:39:41 GMT60Tomcat全攻?/title><link>http://www.tkk7.com/juhongtao/articles/25578.html</link><dc:creator>javaGrowing</dc:creator><author>javaGrowing</author><pubDate>Tue, 27 Dec 2005 07:31:00 GMT</pubDate><guid>http://www.tkk7.com/juhongtao/articles/25578.html</guid><wfw:comment>http://www.tkk7.com/juhongtao/comments/25578.html</wfw:comment><comments>http://www.tkk7.com/juhongtao/articles/25578.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/juhongtao/comments/commentRss/25578.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/juhongtao/services/trackbacks/25578.html</trackback:ping><description><![CDATA[<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr valign="top"><td><span id="yuiqsuu" class="atitle">Tomcat全攻?/span></td> <td width="8"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" border="0" height="1" width="8"></td> <td><br></td> <td width="6"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" border="0" height="1" width="6"></td></tr><!-- Black line separator --> <tr valign="top"> <td colspan="5" bgcolor="#000000"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" border="0" height="1" width="100"></td></tr> <tr valign="top"> <td colspan="5" bgcolor="#ffffff"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" border="0" height="8" width="100"></td></tr></tbody></table><!-- END HEADER AREA --><!-- START BODY AREA --> <table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr valign="top"><td width="10"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" border="0" height="1" width="10"></td> <td width="100%"> <table align="right" border="0" cellpadding="0" cellspacing="0" width="168"> <tbody> <tr><!-- Sidebar Gutter --> <td width="8"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" height="21" width="5"></td> <td width="160"><!-- Start TOC --> <table border="0" cellpadding="0" cellspacing="0" width="160"> <tbody> <tr> <td bgcolor="#000000" height="1" width="160"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" height="1" width="160"></td></tr> <tr> <td align="center" background="l-tomcat.files/bg-gold.gif" height="5"><b>内容Q?/b></td></tr> <tr> <td bgcolor="#666666" height="1" width="160"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" height="1" width="160"></td></tr> <tr> <td align="right"> <table border="0" cellpadding="3" cellspacing="0" width="98%"> <tbody> <tr> <td><a >一Q简?/a></td></tr> <tr> <td><a >二:安装及配|?/a></td></tr> <tr> <td><a >三:应用</a></td></tr> <tr> <td><a >四:lD</a></td></tr> <tr> <td><a >参考资?/a></td></tr> <tr> <td><a >关于作?/a></td></tr></tbody></table></td></tr></tbody></table><!-- End TOC --><!-- Start Related Content Area == <table width="160" border="0" cellspacing="0" cellpadding="0"> <tr><td bgcolor="#000000" height="1" width="160"><img src="/developerWorks/cn/i/c.gif" width="160" height="1" alt=""/></td></tr> <tr><td height="5" background="/developerWorks/cn/i/bg-gold.gif" align="center"><b>相关内容Q?/b></td></tr> <tr><td bgcolor="#666666" height="1" width="160"><img src="/developerWorks/cn/i/c.gif" width="160" height="1" alt=""/></td></tr> <tr><td align=right> <table width="98%" border="0" cellspacing="0" cellpadding="3"> <tr><td><a href=#1>TCP/IP 介绍</a></td></tr> <tr><td><a href=#1>TCP/IP 介绍</a></td></tr> </table> </td></tr></table> !== End Related dW Content Area --> <table border="0" cellpadding="0" cellspacing="0" width="160"> <tbody> <tr> <td colspan="2" bgcolor="#000000" height="2" width="150"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" height="2" width="160"></td></tr> <tr> <td colspan="2" bgcolor="#ffffff" height="2" width="150"><img alt="" src="http://www.huihoo.org/apache/tomcat/l-tomcat.files/c.gif" height="2" width="160"></td></tr></tbody></table><!-- END STANDARD SIDEBAR AREA --></td></tr></tbody></table> <p><a >? ?/a><br>西北大学计算机系士<br>2001 q?12 ?/p> <blockquote>随着java的流行,其在web上的应用也越来越q,tomcat作ؓ一个开源的servlet容器Q应用前景越来越q,本文向你讲qtomcat的一些知识?/blockquote> <p><a id="1" name="1"><span id="auakqqe" class="atitle2">一Q简?/span></a><br>tomcat 是jakarta目中的一个重要的子项目,其被JavaWorld杂志的编辑选ؓ2001q度最具创新的java产品(Most Innovative Java Product)Q同时它又是sun公司官方推荐的servlet和jsp容器(具体可以见http: //java.sun.com/products/jsp/tomcat/)Q因此其来多的受到Y件公司和开发h员的喜爱。servlet和jsp? 最新规范都可以在tomcat的新版本中得到实现?/p> <p><a id="2" name="2"><span id="yiuwsgg" class="atitle2">二:安装及配|?/span></a><br>tomcat最新版本ؓ4.0.1Q这个版本用了一个新的servlet容器CatalinaQ完整的实现了servlet2.3和jsp1.2规范。注意安装之前你的系l必d装了jdk1.2以上版本?/p> <p><span id="ksugaom" class="atitle3">(一)Q安?/span><br>1Qwindowsq_<br>从tomcat|站下蝲<a target="_blank">jakarta-tomcat-4.0.1.exe</a>Q按照一般的windowsE序安装步骤卛_安装好tomcat,安装时它会自动寻找你的jdk和jre的位|?/p> <p>2Qlinuxq_<br>下蝲<a target="_blank">jakarta-tomcat-4.0.1.tar.gz</a>Q将其解压到一个目录?/p> <p><span id="cuwyagw" class="atitle3">(?Q配|?/span><br>q行tomcat需要设|JAVA_HOME变量</p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code>set JAVA_HOME=c:/jdk (win98Q在msdos方式下用,或者放入autoexec.bat?<br>export JAVA_HOME=/usr/local/jdk (linux下用,攑ֈ/etc/bashrc或?etc/profile?<br></code> </pre></td></tr></tbody></table><br><br> <p><span id="wykmmcq" class="atitle3">(?Q运?/span><br>讄完毕后就可以q行tomcat服务器了Q进入tomcat的bin目录Qwin98下用startup启动tomcatQlinux下用startup.shQ相应的关闭tomcat的命令ؓshutdown和shutdown.sh?/p> <p>启动后可以在览器中输入http://localhost:8080/试Q由于tomcat本nhweb服务器的功能Q因此我们不必安装apacheQ当然其也可以与apache集成CP下面会介l?/p> <p>下面你可以测试其自带的jsp和servletCZ?/p> <p><a id="3" name="3"><span id="wogskye" class="atitle2">三:应用</span></a></p> <p><span id="sueyyoe" class="atitle3">(一):目录l构</span><br>tomcat的目录结构如下:</p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td>目录?/td> <td>?/td></tr> <tr> <td>bin</td> <td>存放启动和关闭tomcat脚本</td></tr> <tr> <td>conf</td> <td>包含不同的配|文?server.xml(Tomcat的主要配|文?和web.xml</td></tr> <tr> <td>work</td> <td>存放jsp~译后生的class文g</td></tr> <tr> <td>webapp</td> <td>存放应用E序CZQ以后你要部|的应用E序也要攑ֈ此目?/td></tr> <tr> <td>logs</td> <td>存放日志文g</td></tr> <tr> <td>lib/japser/common</td> <td>q三个目录主要存放tomcat所需的jar文g</td></tr></tbody></table><br><br> <p><span id="wwakesq" class="atitle3">(?Qserver.xml配置?/span><br>下面我们讲q这个文件中的基本配|信息,更具体的配置信息见tomcat的文?/p> <table bgcolor="#cccccc" border="1" cellpadding="0" cellspacing="0" width="80%"> <tbody> <tr> <td width="27%">元素?/td> <td width="21%">属?/td> <td width="52%">解释</td></tr> <tr> <td rowspan="2" width="27%">server</td> <td width="21%">port</td> <td width="52%">指定一个端口,q个端口负责监听关闭tomcat的请?/td></tr> <tr> <td width="21%">shutdown</td> <td width="52%">指定向端口发送的命o字符?/td></tr> <tr> <td width="27%">service</td> <td width="21%">name</td> <td width="52%">指定service的名?/td></tr> <tr> <td rowspan="7" width="27%">Connector<br>(表示客户端和service之间的连?</td> <td width="21%">port</td> <td width="52%">指定服务器端要创建的端口Pq在q个断口监听来自客户端的h</td></tr> <tr> <td width="21%">minProcessors</td> <td width="52%">服务器启动时创徏的处理请求的U程?/td></tr> <tr> <td width="21%">maxProcessors</td> <td width="52%">最大可以创建的处理h的线E数</td></tr> <tr> <td width="21%">enableLookups</td> <td width="52%">如果为trueQ则可以通过调用request.getRemoteHost()q行DNS查询来得到远E客L的实际主机名Q若为false则不q行DNS查询Q而是q回其ip地址</td></tr> <tr> <td width="21%">redirectPort</td> <td width="52%">指定服务器正在处理httph时收C一个SSL传输h后重定向的端口号</td></tr> <tr> <td width="21%">acceptCount</td> <td width="52%">指定当所有可以用的处理h的线E数都被使用Ӟ可以攑ֈ处理队列中的h敎ͼ过q个数的h不予处?/td></tr> <tr> <td width="21%">connectionTimeout</td> <td width="52%">指定时的时间数(以毫Uؓ单位)</td></tr> <tr> <td width="27%">Engine<br>(表示指定service中的h处理机,接收和处理来自Connector的请?</td> <td width="21%">defaultHost</td> <td width="52%">指定~省的处理请求的L名,它至与其中的一个host元素的name属性值是一L</td></tr> <tr> <td rowspan="3" width="27%">Context<br>(表示一个web应用E序Q通常为WAR文gQ关于WAR的具体信息见servlet规范)</td> <td width="21%">docBase</td> <td width="52%">应用E序的\径或者是WAR文g存放的\?/td></tr> <tr> <td width="21%">path</td> <td width="52%">表示此web应用E序的url的前~Q这栯求的url为http://localhost:8080/path/****</td></tr> <tr> <td width="21%">reloadable</td> <td width="52%">q个属性非帔R要,如果为trueQ则tomcat会自动检应用程序的/WEB-INF/lib ?WEB-INF/classes目录的变化,自动装蝲新的应用E序Q我们可以在不重起tomcat的情况下改变应用E序</td></tr> <tr> <td rowspan="3" width="27%"> <p>host<br>(表示一个虚拟主?</p></td> <td width="21%">name</td> <td width="52%">指定L?/td></tr> <tr> <td width="21%">appBase</td> <td width="52%">应用E序基本目录Q即存放应用E序的目?/td></tr> <tr> <td width="21%">unpackWARs</td> <td width="52%">如果为trueQ则tomcat会自动将WAR文g解压Q否则不解压Q直接从WAR文g中运行应用程?/td></tr> <tr> <td rowspan="4"> <p>Logger<br>(表示日志Q调试和错误信息)</p></td> <td width="21%">className</td> <td width="52%">指定logger使用的类名,此类必须实现org.apache.catalina.Logger 接口</td></tr> <tr> <td width="21%">prefix</td> <td width="52%">指定log文g的前~</td></tr> <tr> <td width="21%">suffix</td> <td width="52%">指定log文g的后~</td></tr> <tr> <td width="21%">timestamp</td> <td width="52%">如果为trueQ则log文g名中要加入时_如下?localhost_log.2001-10-04.txt</td></tr> <tr> <td width="27%"> <p>Realm<br>(表示存放用户名,密码及role的数据库)</p></td> <td width="21%">className</td> <td width="52%">指定Realm使用的类名,此类必须实现org.apache.catalina.Realm接口</td></tr> <tr> <td rowspan="3"> <p>Valve<br>(功能与Logger差不多,其prefix和suffix属性解释和Logger 中的一?</p></td> <td width="21%">className</td> <td width="52%"> <p>指定Valve使用的类名,如用org.apache.catalina.valves.AccessLogValvecd以记录应用程序的讉K信息</p></td></tr> <tr> <td width="21%">directory</td> <td width="52%">指定log文g存放的位|?/td></tr> <tr> <td width="21%">pattern</td> <td width="52%">有两个|common方式记录q程L名或ip地址Q用户名Q日期,W一行请求的字符ԌHTTP响应代码Q发送的字节数。combined方式比common方式记录的值更?/td></tr></tbody></table> <p>? 意:1Q经q我试Q我讄Context 的path="",reloadable=trueQ然后放一个WAR文g到webapps目录Q结果tomcat不能出此文?重vtomcat? ?Q而把此文件解压,则tomcat会自动检出q个新的应用E序。如果不能自动检WAR文gQ我们可以利用下面管理中讲的Ҏ来部|应用程序?/p> <p>2Q默认的server.xml中,Realm元素只设|了一个className属性,但此文g中也包含几个通过JDBCq接到数据库q行验证的示?被注释掉?Q通过Realm元素我们可以实现容器安全理(Container Managed Security)?/p> <p>3Q还有一些元素我们没有介l,如ParameterQloaderQ你可以通过tomcat的文获取这些元素的信息?/p> <p><span id="ecwyqgw" class="atitle3">(?Q管?/span></p> <p><b>1Q配|?/b><br>在进行具体的理之前Q我们先ltomcatd一个用P使这个用h权限来进行管理?/p> <p>打开conf目录下的tomcat-users.xml文gQ在相应的位|添加下面一行:</p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code><user name="zf" password="zf" roles="standard,manager"/> <br></code> </pre></td></tr></tbody></table><br><br> <p>注意Q这一行的最后部分一定是/>,tomcat的文掉?W号Q如果没?W号的话Qtomcat重v时将无法讉K应用E序。通过logs/catalina.out文g你可以看到这个错误的详细信息?/p> <p>然后重vtomcatQ在览器中输入http://localhost:8080/manager/Q会弹出对话框,输入上面的用户名和密码即可?/p> <p><b>2Q应用程序列?/b><br>在浏览器中输入http://localhost:8080/manager/listQ浏览器会昄如下的信息:</p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code>OK - Listed applications for virtual host localhost<br>/ex:running:1<br>/examples:running:1<br>/webdav:running:0<br>/tomcat-docs:running:0<br>/manager:running:0<br>/:running:0</code> </pre></td></tr></tbody></table><br><br> <p>面的信息分别为应用程序的路径Q当前状?running 或者stopped)Q与q个E序相连的session数?/p> <p><b>3Q重新装载应用程?/b><br>在浏览器中输? http://localhost:8080/manager/reload?path=/examplesQ浏览器昄如下Q?/p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code>OK - Reloaded application at context path /examples <br></code> </pre></td></tr></tbody></table><br><br> <p>表示example应用E序装蝲成功Q如果我们将server.xml的Context元素的reloadable属性设为true(见上面表?Q则没必要利用这U方式重新装载应用程序,因ؓtomcat会自动装载?/p> <p><b>4Q显Csession信息</b><br>在浏览器中输入http://localhost:8080/manager/sessions?path=/examplesQ浏览器昄如下Q?/p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code>OK - Session information for application at context path /examples Default maximum session inactive interval 30 minutes <br></code> </pre></td></tr></tbody></table><br><br> <p><b>5Q启动和关闭应用E序</b><br>在浏览器中输入http://localhost:8080/manager/start?path=/examples和http://localhost:8080/manager/stop?path=/examples分别启动和关闭examples应用E序?/p> <p><b>6Q部|及撤销部v</b><br>WAR有两U组l方式,一U是按一定的目录l构l织文gQ一U是一个后~为WAR的压~包Q因此它的部|方式也有两U:<br>(1)Q在览器中输入Q?code>http://localhost:8080/manager/install?path=/examples&war=file:/c:\examples</code><br>׃按目录l构l织的WAR部v</p> <p>(2)Q如果输?<code>http://localhost:8080/manager/install?path=/examples&war=jar:file:/c:\examples.war!/</code><br>׃按压羃包组l的WAR部vQ注意此url后半部分一定要?/受?/p> <p>部v后就可以?http://localhost:8080/examples讉K了?/p> <p>在浏览器中输入:<code>http://localhost:8080/manager/remove?path=/examples</code><br>׃撤销刚才部v的应用程序?/p> <p><span id="mogikiy" class="atitle3">(?Q与apache集成</span><br>虽然tomcat也可以作web服务?但其处理静态html的速度比不上apache,且其作ؓweb服务器的功能q不如apache,因此我们xapache和tomcat集成h?/p> <p>我们以linuxpȝZ介绍.</p> <p>从apache|站下蝲<a target="_blank">apache1.3.22源代码版?/a>Q然后用如下命令配|安装apacheQ?/p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code>mkdir /usr/local/apache<br>tar zxvf apache.1.32.tar.gz<br>cd apache.1.32<br>./configure --prefix=/usr/local/apache --enable-module=so <br>make<br>make install<br></code> </pre></td></tr></tbody></table><br><br> <p>注意configure命o指定目标安装目录Qƈ且加入DSO(Dynamic Shared Object)支持Q注意一定不要忘了这一个选项?/p> <p>然后下蝲<a target="_blank">webapp模块</a>Q将解压后mod_webapp.so文g攑օapache的libexec目录Q编辑apache的conf目录下的httpd.confQ在q个文g的最后加入下面三行:</p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code>LoadModule webapp_module libexec/mod_webapp.so<br>WebAppConnection warpConnection warp localhost:8008<br>WebAppDeploy examples warpConnection /examples/ <br></code> </pre></td></tr></tbody></table><br><br> <p>W一行是加入webapp模块Q如果编译apache时不增加DSO支持Q则无法使用LoadModule指oQ第二行指定tomcat与apache的连接,W三行指定部|那个应用,q两个指令用格式如下:</p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code>WebAppConnection [connection name] [provider] [host:port]<br>WebAppDeploy [application name] [connection name] [url path] <br></code> </pre></td></tr></tbody></table><br><br> <p>其中connection name指定q接名,provider只能是warpQport端口与你的tomcat的配|文件server.xml最后几行指定的要保持一致。文件如下:</p> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="100%"><tbody> <tr> <td><pre><code><Service name="Tomcat-Apache"> <br><Connector className="org.apache.catalina.connector.warp.WarpConnector"<br>port="8008" minProcessors="5" maxProcessors="75"<br>enableLookups="true"<br>acceptCount="10" debug="0"/><br>******<br></Service> <br></code> </pre></td></tr></tbody></table><br><br> <p>application name与你在tomcat中部|的应用名一_url path指定讉Kq个应用的url。例如上面的例子可以通过http://localhost/examples/来访问tomcat中的examples应用?/p> <p><span id="wwgakiq" class="atitle3">(?Q中文问?/span><br>一般jsp的ؕ码问题可以通过在jsp中加?lt;%@ page contentType="text/html;charset=GB2312" %>来解冻I至于servlet的ؕ码在可以使用servlet2.3中提供的HttpServeletRequest.setCharacterEncoding函数。更详细的中文问题请?a target="_blank">JSP/Servlet 中的汉字~码问题</a>?/p> <p><a id="4" name="4"><span id="isosgcc" class="atitle2">四:lD</span></a><br>tomcat作ؓ一个servlet(jsp也被~译为servlet执行)容器Q其应用前景是非常好的,如果?a target="_blank">jboss</a>l合hQ则可以实现sun的j2ee规范(用jboss作ejb服务?。jboss的官方网站也提供集成了tomcat3.2*的jboss以供下蝲。另外一个开源的应用服务?<a target="_blank">enhydra</a>) 也是Ztomcat的,其提供了更友好的理界面Q部|应用程序也更简单,功能也更强大?/p> <p><a id="resources" name="resources"><span id="ksegsqe" class="atitle2">参考资料:</span></a></p> <ul class="n01"><li><a >tomcat文</a> </li><li><a >http://www.jguru.com/faq/Tomcat</a> </li><li><a >apache的文?/a> </li></ul><br><br> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td><a id="author1" name="author1"><span id="wegacsg" class="atitle2">关于作?/span></a> <br>宗锋Q西北大学计机pȝ士,对于Z web 的各U新技术都感兴?/td></tr></tbody></table></td></tr></tbody></table><img src ="http://www.tkk7.com/juhongtao/aggbug/25578.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/juhongtao/" target="_blank">javaGrowing</a> 2005-12-27 15:31 <a href="http://www.tkk7.com/juhongtao/articles/25578.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>多个l典p学习|站http://www.tkk7.com/juhongtao/articles/16753.htmljavaGrowingjavaGrowingTue, 25 Oct 2005 06:23:00 GMThttp://www.tkk7.com/juhongtao/articles/16753.htmlhttp://www.tkk7.com/juhongtao/comments/16753.htmlhttp://www.tkk7.com/juhongtao/articles/16753.html#Feedback0http://www.tkk7.com/juhongtao/comments/commentRss/16753.htmlhttp://www.tkk7.com/juhongtao/services/trackbacks/16753.html多个l典p学习|站

http://www.edunet.com/elt
主题Q是一个全方位的学p作ؓW二语言的网?BR>功能Q聊天室Q语法讲解,l习Q小试Q成语讲?BR>特色Q特别深入地介绍了语法,听力Q沟通技巧等
对象QESL教师和学p人士

《世界日报》北版-生活语
http://www.chineseworld.com/publish/37_9999.r/r.htm
主题Q生zd和实用化的英语网?BR>功能Q分主题讲解p的实用方法,q有母语非英语h士闹的语aW话
特色Q灵zȝ动,有许多实?BR>对象Q英语基教好的h?BR>
http://www.englishtown.com
主题Q是目前|上最有深度的p学习|站
功能Q非常好的语法讲解,l习Q和阅读材料
特色Q正宗英国英?BR>对象Q学p人士

http://www.english-at-home.com/
主题Q是一个全方位的学p作ؓW二语言的网?BR>功能Q聊天室Q语法讲解,l习Q小试Q成语讲?BR>特色Q特别深入地介绍了语法,听力Q沟通技巧等
对象QESL教师和学p人士

http://www.englishbaby.com/
主题Q是一个年Mh学习交流的美国英语网?BR>功能Q每天不同的|上评Q以国行文化Z?BR>特色Q可以学到很多美国俚语和方言
对象Q面向年Mh

http://www.englishclub.net/
主题Q丰富齐全的商业性英文网?BR>功能Q语法讲解,l习Q参考资料,教师材料
对象QESL教师和学p人士

http://www.englishpage.com/index.html
主题Q针对英文基较好的学习h士和教师的网?BR>功能Q阅读,游戏。语法讲解,讨论{?BR>特色Q深入讲解了时态用法,每周有新评推出Q旧评可以在存中扑ֈ
对象QESL教师和学p人士

http://members.home.net/englishzone/index.html
主题Q非商业性英文学习网?BR>功能Q语法讲解,l习Q小成语讲解Q英文笑话,阅读和写?BR>对象Q学p人士

http://www.homestead.com/ESLflow/Index.html
主题Q内容组l得很好的英文网?BR>功能Q语法讲解,口语Q英语对话,阅读和课E安?BR>特色Q用程囄方式讲解p语法概念
对象QESL教师和学p人士

http://www.eslhouse.com/
主题Q内容广泛,参考资料甚?BR>功能Q大量词汇讲解,评安排和参考资?BR>特色Q多媒体中心可播放课E?BR>对象QESL教师和学p人士

http://www.eslpartyland.com/default.htm
主题Q自学和互相交流
功能Q?5个互动式试?5个论坛,让学生互怺,教师可以下蝲评材料
特色Q互动式
对象QESL教师和学p人士

http://gwis2.circ.gwu.edu/~gwvcusas/
主题Q由George Washington University的Professor Christine Melonil护的ESL链接|页
功能Q有学多学习p的链?BR>对象QESL教师和学p人士

http://www.ToLearnEnglish.com
主题Q内容广泛,资源丰富Q值得一?BR>功能Q聊天室Q语法讲解,l习Q小试Q图片,论坛
特色Q做完练习可以得到评语,老师可以在线制作试题
对象QESL教师和学p人士

http://deil.lang.uiuc.edu/
主题Q包括了|上学英语的一些最基本的内?BR>功能Q语法讲解,l习Q互动式3听力训练Q笔友交换,教师参?BR>对象QESL教师和学p人士

http://www.longman-elt.com/index.html
主题Qؓ中国朋友所熟知的朗D语教学方?BR>功能Q测试,专题文章Q链接,窍?BR>对象QESL教师和学p人士

http://www.parlo.com/index.asp
主题Q学语言的网?BR>功能Q对语言l构Q国际文化作出探?BR>特色Q教你怎样学语aQ而不仅是p
对象QESL教师和学p人士

http://www.peakenglish.com
主题Q在U的q程p学习|站 功能Q词汇,阅读Q听?用REALAUDIO)Q语法课E,
特色Q所教英语是用于国?BR>对象Q学p人士

http://schmooze.hunter.cuny.edu:8888/
主题Q英语学习个|站Q可以一对一或分组q行对话
功能Q在U字典,语言游戏QUSENET
对象Q学p人士

http://members.tripod.com/~towerofenglish/index.htm
主题Q非常友好的英文学习|站
功能Q设计专业的|站Q大量的有用资源
对象Q学p人士

非常不错Q大多数是英语教学的p|站Q国内网站其实学p的都不错Q而且一些英语听力和口语的网站还有不,特别是那些VOA{原声听力网站?BR>博客|址中还有一些:

http://wz.blogchina.com/2650405/index.htm

可以参考。比如这?http://www.unsv.com
是英语听力的好帮手?


javaGrowing 2005-10-25 14:23 发表评论
]]>
Java Learning Path资源http://www.tkk7.com/juhongtao/articles/12706.htmljavaGrowingjavaGrowingMon, 12 Sep 2005 01:58:00 GMThttp://www.tkk7.com/juhongtao/articles/12706.htmlhttp://www.tkk7.com/juhongtao/comments/12706.htmlhttp://www.tkk7.com/juhongtao/articles/12706.html#Feedback0http://www.tkk7.com/juhongtao/comments/commentRss/12706.htmlhttp://www.tkk7.com/juhongtao/services/trackbacks/12706.html
1?http://java.sun.com/ (英文)
Sun的Java|站Q是一个应该经常去看的地方。不用多说?

2、http://www-900.ibm.com/developerWorks/cn/
IBM的developerWorks|站Q英语好的直接去英文ȝ点看。这里不但是一个极好的面向对象的分析设计网站,也是Web ServicesQJavaQLinux极好的网站。强烈推荐!Q!

3、http://www.javaworld.com/ (英文)
关于Java很多新技术的讨论和新闅R想多了解Java的方斚w面的应用Q这里比较好?

4、http://dev2dev.bea.com.cn/index.jsp
BEA的开发者园圎ͼBEA作ؓ最重要的App Server厂商Q有很多独到的技术,在Weblogic上做开发的朋友不容错过?

5、http://www.huihoo.com/
灰狐动力|站Q一个专业的中间件网站,虽然不是专业的Java|站Q但是在J2EE企业应用技术方面有深厚的造诣?

6、http://www.theserverside.com/home/ (英文)
TheServerSide是一个著名的专门面向Java Server端应用的|站?

7、http://www.javaresearch.org/
Java研究l织Q有很多优秀的Java斚w的文章和教程Q特别是在JDO斚w的文章比较丰富?

8、http://www.cnjsp.org/
JSP技术网站,有相当多的Java斚w的文章和资源?

9、http://www.jdon.com/
Jdon论坛Q是一个个人性质的中文J2EE专业技术论坛,在众多的Java的中文论坛中QJdon一个是技术含量非帔RQ帖子质量非常好的论坛?

10、http://sourceforge.net/
SourgeForge是一个开放源代码软g的大本营Q其中也有非帔R怸富的Java的开放源代码的著名的软g?
11. http://www.matrix.org.cn

javaGrowing 2005-09-12 09:58 发表评论
]]>
StringBuffer versus String http://www.tkk7.com/juhongtao/articles/12702.htmljavaGrowingjavaGrowingMon, 12 Sep 2005 01:25:00 GMThttp://www.tkk7.com/juhongtao/articles/12702.htmlhttp://www.tkk7.com/juhongtao/comments/12702.htmlhttp://www.tkk7.com/juhongtao/articles/12702.html#Feedback0http://www.tkk7.com/juhongtao/comments/commentRss/12702.htmlhttp://www.tkk7.com/juhongtao/services/trackbacks/12702.html
Summary
Reggie illuminates the underlying performance impact of using the StringBuffer and String classes when performing concatenations. (600 words)
By Reggie Hutcherson

Java provides the StringBuffer and String classes, and the String class is used to manipulate character strings that cannot be changed. Simply stated, objects of type String are read only and immutable. The StringBuffer class is used to represent characters that can be modified.

The significant performance difference between these two classes is that StringBuffer is faster than String when performing simple concatenations. In String manipulation code, character strings are routinely concatenated. Using the String class, concatenations are typically performed as follows:

String str = new String ("Stanford ");
str += "Lost!!";

If you were to use StringBuffer to perform the same concatenation, you would need code that looks like this:

StringBuffer str = new StringBuffer ("Stanford ");
str.append("Lost!!");

Developers usually assume that the first example above is more efficient because they think that the second example, which uses the append method for concatenation, is more costly than the first example, which uses the + operator to concatenate two String objects.

The + operator appears innocent, but the code generated produces some surprises. Using a StringBuffer for concatenation can in fact produce code that is significantly faster than using a String. To discover why this is the case, we must examine the generated bytecode from our two examples. The bytecode for the example using String looks like this:

0 new #7
3 dup
4 ldc #2
6 invokespecial #12
9 astore_1
10 new #8
13 dup
14 aload_1
15 invokestatic #23
18 invokespecial #13
21 ldc #1
23 invokevirtual #15
26 invokevirtual #22
29 astore_1

The bytecode at locations 0 through 9 is executed for the first line of code, namely:

String str = new String("Stanford ");

Then, the bytecode at location 10 through 29 is executed for the concatenation:

str += "Lost!!";

Things get interesting here. The bytecode generated for the concatenation creates a StringBuffer object, then invokes its append method: the temporary StringBuffer object is created at location 10, and its append method is called at location 23. Because the String class is immutable, a StringBuffer must be used for concatenation.

After the concatenation is performed on the StringBuffer object, it must be converted back into a String. This is done with the call to the toString method at location 26. This method creates a new String object from the temporary StringBuffer object. The creation of this temporary StringBuffer object and its subsequent conversion back into a String object are very expensive.

In summary, the two lines of code above result in the creation of three objects:

A String object at location 0
A StringBuffer object at location 10
A String object at location 26
Now, let's look at the bytecode generated for the example using StringBuffer:

0 new #8
3 dup
4 ldc #2
6 invokespecial #13
9 astore_1
10 aload_1
11 ldc #1
13 invokevirtual #15
16 pop

The bytecode at locations 0 to 9 is executed for the first line of code:

StringBuffer str = new StringBuffer("Stanford ");

The bytecode at location 10 to 16 is then executed for the concatenation:

str.append("Lost!!");

Notice that, as is the case in the first example, this code invokes the append method of a StringBuffer object. Unlike the first example, however, there is no need to create a temporary StringBuffer and then convert it into a String object. This code creates only one object, the StringBuffer, at location 0.

In conclusion, StringBuffer concatenation is significantly faster than String concatenation. Obviously, StringBuffers should be used in this type of operation when possible. If the functionality of the String class is desired, consider using a StringBuffer for concatenation and then performing one conversion to String.

About the author
Reggie Hutcherson is a Sun technology evangelist. He evangelizes Sun's Java 2 Platform technologies around the world concentrating on J2SE and the HotSpot performance engine.

Resources

"JavaWorld debuts new weekly Java performance column," Reggie Hutcherson (JavaWorld, March 2000):
http://www.javaworld.com/jw-03-2000/jw-03-javaperf.html

"The basics of Java performance," Reggie Hutcherson (JavaWorld, March 2000):
http://www.javaworld.com/jw-03-2000/jw-03-javaperf_2.html

"Performance problem or design problem?" Reggie Hutcherson (JavaWorld, March 2000):
http://www.javaworld.com/jw-03-2000/jw-03-javaperf_3.html

"Compiler optimizations," Reggie Hutcherson (JavaWorld, March 2000):
http://www.javaworld.com/jw-03-2000/jw-03-javaperf_4.html



javaGrowing 2005-09-12 09:25 发表评论
]]>
Java - A Slow Language? It Depends on What You're Talking Abouthttp://www.tkk7.com/juhongtao/articles/12701.htmljavaGrowingjavaGrowingMon, 12 Sep 2005 01:24:00 GMThttp://www.tkk7.com/juhongtao/articles/12701.htmlhttp://www.tkk7.com/juhongtao/comments/12701.htmlhttp://www.tkk7.com/juhongtao/articles/12701.html#Feedback0http://www.tkk7.com/juhongtao/comments/commentRss/12701.htmlhttp://www.tkk7.com/juhongtao/services/trackbacks/12701.htmlby Joakim Dahlstedt
01/29/2004

In the past six years or so the claim that Java is a slow language has regularly appeared in articles and news discussions. Most of the time I follow the debate, but after a while I get bored because the discussions remain at the micro-benchmark level. It continues to amaze me that there isn't more focus on system-level performance in discussions of language performance.

Having spent seven years actively interested in the field of runtime system optimization and the past four years designing a server-side JVM, JRockit, I am pretty convinced that micro-benchmark results cannot be extended to the system level, where performance really matters. Thus, I thought it would be interesting to give you a view of the performance issue from a JVM developer perspective. I'm arguing that Java is anything but a slow and inefficient language, and that the JVM is the key component ensuring that the system is as fast and easy to deploy and run as it was fast and easy to develop.

Performance Is Not a Micro-Benchmark
This is 2002 and people are still arguing that Java is a slow language. The most common argument comes from developers who have written small benchmarks in Java and then rewritten them in C and are touting how much faster the C programs are. I'm not writing this article to claim that they are wrong.

Of course they can write micro-benchmarks in a couple lines of Java code and redo the same benchmarks in C/C++ and the C programs will probably run faster than the Java programs. That's not where I disagree with them. I disagree with their conclusion; the results of a small micro-benchmark test cannot be extended to say anything about a large-scale application. I believe most systems will be built faster by fewer developers and they will even run faster if they are written in Java instead of C. Java is a language of scale; C is a language of micro-level performance. The development of Java is a natural result of the evolution of system development.

The System Development Evolution: From Punch Cards to Web Services
What has happened during the past 30 years or so is an explosion - the explosion of large-scale system development. There are so many developers in the world now, and they're building systems that are larger than what anyone imagined possible 30 years ago. In addition, application development today is no longer an I-build-every-part-of-the-application-myself process. People use standard libraries, frameworks, application servers, and most recently, Web services, to build their applications.

The components are getting bigger and bigger and more and more general. These building blocks, which were once looked upon with disbelief and mistrust, are now taken for granted. However, using these general building blocks has a price: performance. We have traded performance for significantly reduced development time and system complexity. At least that's what we think and what our early measurements indicate. What if we're wrong?

Enter Java and JVMs
The beauty of Java from a large-scale application performance perspective is in two features that are very crucial to performance for large-scale systems: type information and a runtime system (the JVM). The type information is needed by the code generator to discern who calls who, and who points to who. As a result more information can be extracted from a Java program than from a C program, if the compiler is smart. The end result is, of course, higher performance. The JVM is the vehicle for dynamic optimization. The JVM can analyze the behavior of the application and adapt itself and the generated code to the application.

The beauty of this runtime optimization approach is that for the first time ever, the whole system can be optimized specifically for how it is used without having the source code. This is the opportunity. The framework developer can build a general framework that gets used by application developers and that gets optimized specifically for each application that uses the framework. The general building blocks are broken down and melt into each other at runtime. It is the responsibility of the JVM to do this melting. The JVMs, including JRockit, have not reached that goal...yet.

When Dynamic Optimization Really Pays Off
Let me give you another example of the benefits of dynamic optimization. Look at Intel's new 64-bit platform, the Itanium Processor. Its characteristics are novel and enticing. Nevertheless, its EPIC architecture puts very high pressure on the compiler. EPIC means that the compiler has to choose which instructions should be executed in parallel. Most normal processors today do that selection automatically in their out-of-order execution engine. Because the EPIC-based CPUs need to make fewer decisions, they increase the computational efficiency. The caveat is that the compiler has to make intelligent decisions for the performance to increase.

Given all this pressure on the compiler, you might think that EPIC architecture is well-suited for static compilation and that it virtually eliminates the need for a dynamic runtime system. I believe we'll be able to show you in the coming years how totally opposite the reality is. The reason is that the devil is in the details: for the compiler to be able to parallelize code in a good way requires more than knowing the instructions of the program. The compiler has to know two more things: the flow of the program, and the values that are passed around and used in different contexts.

A static compiler doesn't have this runtime information; it cannot tell what parts of the program are executed frequently or what values are commonly passed to a function from a specific call site. A dynamic runtime system, e.g., a JVM, is the easiest kind of system to collect and take advantage of such information. Consequently, I expect to see exciting gains during the next two years for the Itanium-based JVMs. There is a possibility that they'll catch up with and supercede the profile-guided C compilers on EPIC platforms. Because it lacks type information and a runtime system, C is inferior to Java for EPIC architecture.

The JVM - The Glue for the Building Blocks
BEA acquired JRockit in February of this year, and we are now working to integrate JRockit into the BEA product line, making sure that it works well with all of the different BEA products. Bringing the building blocks and glue under the same roof makes your system more manageable and scalable and makes it run faster. The JRockit JVM is becoming an important piece of the BEA WebLogic Platform.

In conclusion, I still expect to see a lot of micro-benchmarks out there comparing Java and C programs, but I hope I've convinced you that using runtime systems like Sun Microsystems' HotSpot or BEA WebLogic JRockit Java is not slow or inefficient, and that the performance of a large-scale system built with Java may be superior to that of the same system built using C.

Copyright © 2002 SYS-CON Media, Inc.


javaGrowing 2005-09-12 09:24 发表评论
]]>
վ֩ģ壺 ޹һ˾þþƷ| ëƬ߹ۿվ| ɫƵ| վ߹ۿ | ŮaܴƬ| ˳ɵӰվþ| ۲ӰԺѹۿ| Ʒ޳a߹ۿ| һëƬ߹ۿ| Ʒ͵Ƶѹۿ | ҹ99Ƶ| عΰAëƬѿ| ޾Ʒþþwww | þƵ| Ƶ| պһ| ޹Ʒ˿߹ۿ| ɫwwwվ| 99þ޾ƷëƬ| ëƬӰƬ| AVAV̾þ| ëbbw| 91Ʒѹۿ| ޹Ʒ۲ӰԺ| MM131޹Ůþ| þ99ۺϾƷ| ޹av| ޾ƷɫƵ߹ۿԴ | þ޸ۺ| þ99ۺϾƷ| AVһ| þAV| avվëƬ| ѹ߾Ʒһ| AV뾫Ʒ鶹| ëƬ߹ۿվ| ˾þվ| avһ| ޳aƬ77777kkkk| ѹۿ| 91ѹۿ|