<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[enoeht的专栏]]></title><description><![CDATA[没有翅膀也要学会飞翔]]></description><link>https://blog.csdn.net/enoeht</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; enoeht]]></copyright><item><title><![CDATA[处理没有被捕获的异常]]></title><link>https://blog.csdn.net/enoeht/article/details/52473</link><guid>https://blog.csdn.net/enoeht/article/details/52473</guid><author>enoeht</author><pubDate>Mon, 26 Jul 2004 18:20:00 +0800</pubDate><description><![CDATA[     在我们的程序中并不是所有的异常都被捕获，有些是因为我们不想捕获，因为我们认为那些异常没必要捕获 而有些是我们无法捕获的，因为我们不能确定它们会在什么地方出现，例如像NullPointerException，ClassCastException，IndexOutOfBoundsException这些RuntimeException。我们也许可以在所有它们有可能发生的地方去捕获它们，但这确实]]></description><category></category></item><item><title><![CDATA[Observable与Observer]]></title><link>https://blog.csdn.net/enoeht/article/details/52451</link><guid>https://blog.csdn.net/enoeht/article/details/52451</guid><author>enoeht</author><pubDate>Mon, 26 Jul 2004 17:58:00 +0800</pubDate><description><![CDATA[    在Java中通过Observable类和Observer接口实现了观察者模式。一个Observer对象监视着一个Observable对象的变化，当Observable对象发生变化时，Observer得到通知，就可以进行相应的工作。例如在文档/视图结构中，文档被修改了，视图就会得到通知。       java.util.Observable中有两个方法对Observer特别重要，一个是set]]></description><category></category></item><item><title><![CDATA[一个在程序中实现plugin机制的简单例子]]></title><link>https://blog.csdn.net/enoeht/article/details/52431</link><guid>https://blog.csdn.net/enoeht/article/details/52431</guid><author>enoeht</author><pubDate>Mon, 26 Jul 2004 17:42:00 +0800</pubDate><description><![CDATA[所有的plugin模块都应该实现一个ModuleInterface接口： public interface ModuleInterface { ???public boolean handles(Object key); } 这意味着所有的模块都有一个handles方法，这个方法提供了一个挑选模块的机制，根据传入的对象识别模块，例如传入一个String，根据这个String判断这是不是一个适用的模]]></description><category></category></item><item><title><![CDATA[Servlet访问路径]]></title><link>https://blog.csdn.net/enoeht/article/details/52428</link><guid>https://blog.csdn.net/enoeht/article/details/52428</guid><author>enoeht</author><pubDate>Mon, 26 Jul 2004 17:40:00 +0800</pubDate><description><![CDATA[http://company/shopping/loginServlet 通常用这样的路径来访问webroot/company/shopping /WEB-INF/classes目录下的一个servlet   http://company/shopping/servlet/ login 默认情况下servlet的URL都被设置在一个servlet下  invoker /servlet/*    h]]></description><category></category></item><item><title><![CDATA[检测用户浏览器的Cookie设置]]></title><link>https://blog.csdn.net/enoeht/article/details/52425</link><guid>https://blog.csdn.net/enoeht/article/details/52425</guid><author>enoeht</author><pubDate>Mon, 26 Jul 2004 17:38:00 +0800</pubDate><description><![CDATA[这是一个检测用户浏览器的Cookie设置是否打开的一个小技巧。 技巧很简单，当servlet接收到一个请求时，先不处理这个请求，而是发送一个响应，在响应中包含一个cookie并且要求浏览器在接到这个响应后立即再重发上一个请求，并在请求中添加这个cookie，然后在servlet中检测浏览器第二次发的请求中是否有这个cookie，如果没有就说明这个浏览器不支持cookie，有就对这个请求进行应作的处]]></description><category></category></item><item><title><![CDATA[在Java中处理日志记录]]></title><link>https://blog.csdn.net/enoeht/article/details/52417</link><guid>https://blog.csdn.net/enoeht/article/details/52417</guid><author>enoeht</author><pubDate>Mon, 26 Jul 2004 17:33:00 +0800</pubDate><description><![CDATA[在JDK1.4中提供了一个日志记录包：java.util.logging，它可以对程序中的日志记录进行相当复杂的控制。例如：通过它可以指定日志的级别和日志的位置(控制台、文件、套接字、内存缓冲区)，也可以创建子记录器，通过它可以用程序控制的方式来指定想记录的内容，也可以使用配置文件来指定，而不需要去改动程序。和Log4j相比，它更简单更轻量级，在对日志输出的要求不是很复杂时，它无疑是更好的选择。 ]]></description><category></category></item><item><title><![CDATA[CreateProcess使用心得]]></title><link>https://blog.csdn.net/enoeht/article/details/23671</link><guid>https://blog.csdn.net/enoeht/article/details/23671</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:43:00 +0800</pubDate><description><![CDATA[1、我们用CreateProcess执行一个外部程序时，怎样才能得到这个程序的输入输出呢？CreateProcess已经替我们准备好了，在CreateProcess的STARTUPINFO参数里有这样几个hStdInput、hStdOutput、hStdError东东，用来为创建的进程指定输入输出，例如用CreateFile创建一个文件，接着把得到的文件句柄指定给hStdOutput，并且把dwF]]></description><category></category></item><item><title><![CDATA[NT Service的几个注意点和示例代码]]></title><link>https://blog.csdn.net/enoeht/article/details/23666</link><guid>https://blog.csdn.net/enoeht/article/details/23666</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:41:00 +0800</pubDate><description><![CDATA[如何编写NT Service在MSDN->Platform SDK->DLLs, Processes, and Threads->Service中说得很清楚了，在这里我就不多说了，这里我就只说一些我个人认为的在编写service过程中要注意的地方。   0、在我们通过控制面板或NET START命令启动一个service时， Service Control Manager (SCM)从注册表里拿到]]></description><category></category></item><item><title><![CDATA[Synchronized使用心得]]></title><link>https://blog.csdn.net/enoeht/article/details/23658</link><guid>https://blog.csdn.net/enoeht/article/details/23658</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:35:00 +0800</pubDate><description><![CDATA[用synchronized关键字修饰方法后,程序将根据调用此方法的对象的锁来判断是否能调用此方法。   对一个类的instance method,则当此方法被一个线程调用时,其他线程不能再通过同一个对象调用此方法（可以通过这个类的另一个对象来调用这个方法）。   对一个类的static method，则当一个线程通过类对象调用此方法时，其他线程不能再通过类对象调用此方法。由于类对象在类加载时由虚拟]]></description><category></category></item><item><title><![CDATA[enoeht的Java源码系列(6)--调试信息与日志文件]]></title><link>https://blog.csdn.net/enoeht/article/details/23656</link><guid>https://blog.csdn.net/enoeht/article/details/23656</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:32:00 +0800</pubDate><description><![CDATA[在程序中我们常常用System.out.println来输出调试信息，方便且简单，但是往往是因为它太简单、太方便了，以致于让我们需要用一个更强大更灵活的方法来替代它，这篇文章的目的就是提供了一个这样的方法。   在我的开发过程中，我会对输出的调试信息有这样的期望：在开发的时候，输出大量的细节信息让我能很方便的调试，而到了发布的时候，不用改任何代码，就能让程序只去显示客户会感兴趣的信息；同样不需要改]]></description><category></category></item><item><title><![CDATA[enoeht的Java源码系列(5)--字符串加解密]]></title><link>https://blog.csdn.net/enoeht/article/details/23636</link><guid>https://blog.csdn.net/enoeht/article/details/23636</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:18:00 +0800</pubDate><description><![CDATA[这一篇的内容是一个简单的对字符串加解密的类： Then call its encrypt or decrypt method with an authenticator byte array (the parameter Auth which is a 16 octet byte array) and the data which is wanted to be encoded or decode]]></description><category></category></item><item><title><![CDATA[enoeht的Java源码系列(4)--继续处理配置文件]]></title><link>https://blog.csdn.net/enoeht/article/details/23629</link><guid>https://blog.csdn.net/enoeht/article/details/23629</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:13:00 +0800</pubDate><description><![CDATA[我们还常常会在程序中用到这样的配置文件： [section] key = value 下面是一个这种配置文件中的实例 [Server]     Address=192.168.1.151     Port=8000     Version=1     Info=1 [User]     Name=Kyle     Pwd=1234 [ID]     111;222;333 [END]   在这里提]]></description><category></category></item><item><title><![CDATA[enoeht的Java源码系列(3)--处理配置文件]]></title><link>https://blog.csdn.net/enoeht/article/details/23621</link><guid>https://blog.csdn.net/enoeht/article/details/23621</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:10:00 +0800</pubDate><description><![CDATA[我们常常会在程序中用到这样的配置文件： Listener = org.kyle.net.svr.sample.SampleListenerImpl ServerAddress = 127.0.0.1 ListeningPort = 80 ListenerTimeout = 120 StatelessService = true LogLevel = ALL LogPath = server.log]]></description><category></category></item><item><title><![CDATA[enoeht的Java源码系列(2)--综合工厂]]></title><link>https://blog.csdn.net/enoeht/article/details/23611</link><guid>https://blog.csdn.net/enoeht/article/details/23611</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 12:06:00 +0800</pubDate><description><![CDATA[package org.kyle.net.svr.sample;   public class IntegrationFactory {     public IntegrationFactory()     {     }       public static IListener createListener(GenProfile genCfg)     {       IListener i]]></description><category></category></item><item><title><![CDATA[enoeht的Java源码系列(1)--TCP服务器]]></title><link>https://blog.csdn.net/enoeht/article/details/23588</link><guid>https://blog.csdn.net/enoeht/article/details/23588</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 11:58:00 +0800</pubDate><description><![CDATA[这是一个TCP服务器端的实现代码，监听客户端的请求，在子线程中处理各个客户端发来的数据包，再将处理后的结果送回客户端。这里提供的代码很完整，包括一个mainclass，一个监听class和它的interface，一个包处理class，一个发送class，基本上可以直接使用。其中用到的一些工具类，例如Debug、GenProfile、Terminator等，它们代码也会出现在随后的系列文章中。   ]]></description><category></category></item><item><title><![CDATA[流的重定向]]></title><link>https://blog.csdn.net/enoeht/article/details/23559</link><guid>https://blog.csdn.net/enoeht/article/details/23559</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 11:41:00 +0800</pubDate><description><![CDATA[在我的一项开发工作中，我要用到Duan写的程序，我直接把他那个程序的代码原封不动的包含到我的程序中。  Duan的程序的输出是直接输出到标准输出也就是屏幕上的，而我的程序的输出是到log文件里的。假如我直接去改动他的代码，那就会带来很多麻烦，在这种情况下，最简单的方法就是把标准输出流重新定向到文件中。 我采用替换流缓冲区的方法来重定向流，用rdbuf函数拿一个文件流的缓冲区去替换cout的缓冲区，]]></description><category></category></item><item><title><![CDATA[Java多语言编码问题解析(2)]]></title><link>https://blog.csdn.net/enoeht/article/details/23552</link><guid>https://blog.csdn.net/enoeht/article/details/23552</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 11:38:00 +0800</pubDate><description><![CDATA[这里是一个具体的例子： 现在因为浏览器对UTF-8的支持，我们可以通过在源文件、请求、响应中都使用unicode编码方式，来轻松达到处理国际化和字符编码问题的目标。以我们使用的tomcat4.1.2为例，过程如下： 1、编写JSP页面时：在每个JSP页面在页首都要增加一行：在编辑JSP页面时，一定要确保JSP文件以unicode的方式保存，目前几乎所有的编辑器都有以unicode编码保存或将文件内]]></description><category></category></item><item><title><![CDATA[Java多语言编码问题解析(1)]]></title><link>https://blog.csdn.net/enoeht/article/details/23547</link><guid>https://blog.csdn.net/enoeht/article/details/23547</guid><author>enoeht</author><pubDate>Wed, 23 Jun 2004 11:34:00 +0800</pubDate><description><![CDATA[1、Java编译器在对源文件编译前，会先把源文件转换为unicode编码，因为这个原因，我们在编译时一定要把源文件用的是什么编码方式正确无误的”告诉”编译器。 例如：我们的源文件是以UTF-8的方式保存的，而在编译时编译器却把它当作是用GBK方式保存的，这样编译器就会按照GBK->Unicode的编码转换方法对源文件进行转换，然后再编译，这样当然会出错，实际上编译器应当按照UTF-8->Unico]]></description><category></category></item></channel></rss>