行云与流水
来源: BlogBus 原始链接: http://emmet.blogbus.com:80/s4792/ 存档链接: https://web.archive.org/web/20060128025934id_/http://emmet.blogbus.com:80/s4792/
行云与流水 2005-11-29 Java 配置文件管理类库 TAG: Java_Things 看到几个有关 Java 应用程序的配置文件的管理类库: JFig JConfig Commons Configuration IniEditor tXML 其中 JFig 和 JConfig 非常相像,功能也很强大,以至于在 TSS 的 讨论 中 JConfig 的作者和 JFig 的作者都互相 PK 起来。JFig 支持配置文件的继承,还支持变量的使用,但它依赖 log4j。 这篇文章 详细介绍了 JFig 的使用。 Commons Configuration 显得更加灵活一些,配置文件的数据可以来自很多不同的介质,比如: Properties files XML documents JNDI JDBC Datasource System properties Applet parameters Servlet parameters 不同的配置源可以通过 ConfigurationFactory 和 CompositeConfiguration 融合起来。通过扩展 AbstractConfiguration 和 AbstractFileConfiguration 类可以自定义配置对象,通过它们可以制作出其它配置源的配置参数。 IniEditor 专门用来读取 ini 的配置文件,使用非常简单。 tXML 是 tiny xml 的缩写,非常的小巧好用,不依赖任何第三方库,对于把配置信息保存为 xml 文件一些小型应用程序来说是非常好用的,但在使用过程中,发现对中文支持不好,配置文件中的中文解析都是乱码,改变编码处理也没用,可能源代码有问题。 ant21 @ 13:34 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-11-07 Informa 解析 RSS 时无法连接的问题 TAG: Java_Things 用 Informa 解析 RSS 的时候,总是遇到 NotifyUtil::java.net.ConnectException: Connection refused: connect 的错误,无法连接,然而我仅仅是连接到本机,非常的奇怪啊。网上一通搜索之后,终于发现了原因。 如果安装了 NetBeans ,那么它会在 {tomcat_home}/conf/web.xml 里面加上这样几行: HTTPMonitorFilter org.netbeans.modules.web.monitor.server.MonitorFilter netbeans.monitor.ide 127.0.0.1:8082 HTTPMonitorFilter /* REQUEST FORWARD INCLUDE ERROR 现在只要把这几行注释掉就可以正常连接了。 ant21 @ 21:04 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-10-21 POJO Web Development With Wicket TAG: Java_Things POJO Web Development With Wicket 这份文档是由 Martijn Dashorst 和 Miko Matsumura 编写的,对 Wicket 作了一些基本的讲解,并通过一个简单的地址簿程序演示了 Form Input, Validation, Form Submission, Repeating Items, Deletion 和 Paging 等基本功能在 Wicket 中的实现。 ant21 @ 18:08 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-10-17 WebWork in Action 下载 TAG: Java_Things 无意中发现了 WebWork in Action PDF ebook 的下载地址,需要的朋友抓紧时间了,地址可能随时会有变化哦。 part1 part2 Source Code -- Book example code (7.2 MB) 下面是 manning 关于这本书的一些介绍: WebWork in Action Patrick Lightbody and Jason Carreira Foreword by Rickard Öberg September, 2005 | 400 pages ISBN: 1932394532 Softbound print book: $44.95 PDF ebook: $22.50 DESCRIPTION "My developers love it! We have already improved a couple of applications because of this book."
- Rickard ?berg, Software Architect, Senselogic, Founder of XDoclet and WebWork OpenSource projects. "Well organized and covers all the bases!"
- Anoop Ranganath, Senior Architect, Green Bar Software "Wow! People developing web apps need this. It?s very, very good!"
- Berndt Hamboeck, Senior Architect, Sybase The WebWork framework implements a simple command/ business-logic and MVC design. It provides out-of-the-box functionality developers need to build well-designed applications that are modular and reusable. Written by its two primary developers, WebWork in Action is the first book to focus entirely on WebWork. Like a true "In Action" book, it is both a tutorial on WebWork and a sourcebook for its use in demanding, real-world applications. Starting with "Hello World" the Webwork way, the book immerses the reader in practical, how-to material. You will soon know how to configure WebWork and gradually and incrementally master the robust and powerful uses of the framework. WebWork in Action uses the same basic, continuing example used in Manning's Hibernate in Action to show how to integrate WebWork with the popular Hibernate persistence framework. What's Inside
- Handling data and displaying content with Expression Language and Tag Libraries
- Inversion of Control and WebWork actions
- VelocityType conversion and data validation
- Internationalization and component-oriented design
- Integration of web applications into the Hibernate persistence framework
- Webwork best practices and architecture ABOUT THE AUTHORS... Patrick Lightbody has worked for various technology companies, from Cisco Systems to tiny Silicon Valley startups, and currently leads Jive Software's Professional Services organization. In his spare time he contributes to several OpenSymphony projects. Patrick lives in Portland, Oregon. A developer and J2EE architect, Jason Carreira has lately designed and built enterprise financial software products. He currently works for ePlus on next generation eProcurement solutions. He is a core developer of the XWork command pattern framework and WebWork MVC web framework at OpenSymphony. Jason lives in Rochester, New York. ant21 @ 20:36 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-10-15 Wicket 应用的一个在线演示 TAG: Java_Things 我得承认,我非常喜欢 Wicket 。 从 Wicket 的 wiki 上面,发现来自斯洛伐克的软件开发者 Matej Knopp 开发的一个学校项目,它有一个 在线演示 ,可以让我们对 Wicket 应用有深刻的印象了。 ant21 @ 00:28 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-09-21 webwork 中文问题 TAG: Java_Things 初学 WebWork ,按照自带文档的例子去做,就遇到了中文问题,主要是从资源文件中取得的字符变为乱码,还有就是通过表单提交中文也变为乱码。寻找了很多方法后,发现下面的方法是有效的:
- 在 webwork.properties 里面: webwork.locale=zh_CN webwork.i18n.encoding=UTF-8
- 制作 action 的资源文件:{actionName}_zh_CN.properties 可以使用 JDK 自带的 native2ascii 工具进行转码,或者在 netbeans 里面可以直接进行国际化的处理。
- 在 JSP 里面: 声明 <%@page pageEncoding="UTF-8"%>,或者 <%@page contentType="text/html; charset=UTF-8"%>,我发现两者都能起作用。 不知道这样是否就可以支持世界上所有的语种呢?总之,使用 UTF-8 是原则。 ant21 @ 22:43 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-09-20 netbeans 5.0 TAG: Java_Things netbeans 的下一个版本将是 5.0 而不是 4.2,预计将于 05 年 9 月发行 beta 版,05 年 11 月发行 rc 版,05 年 12 月发行正式版。 启动画面很酷,看起来非常漂亮: daily build 和 q-build 可以在 这里 下载。 5.0 加入了像 IDEA 那样的代码诊断提示功能: 还有新的 GUI 设计器 Matisse: Matisse 的 flash demo 在 这里 观看。 5.0 为我们提供了一个新的 CVS 支持: 详细的 netbeans 5.0 功能介绍请查看 这里 。 ant21 @ 19:44 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-09-20 wx4j TAG: Java_Things wx4j : A Java Binding for wxWidgets 它可以让 Java 直接使用本地的界面组件,不像 Swing 那样模拟本地外观,也不像 SWT 那样重复制作本地组件,wx4j 充分利用了现有的成熟的 wxWidgets C++ 类库并使用 SWIG 来使它们的 API 暴露给 Java 来使用。 看了几个 demo 之后,你能相信这是用 Java 做出来的吗?直接使用本地界面组件,简直太爽了! 不过和 wxPython 比起来,唯一遗憾的就是还不能直接编译为本地可执行文件,运行的时候还是需要 JRE 的支持,不过要是能变成 exe 的话,这还是 Java 吗? ant21 @ 12:38 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-07-07 Pebble 在 Tomcat 5 上的搜索问题 TAG: Java_Things Pebble 1.8 在 Tomcat 5 上面的中文搜索问题终于解决了。 在 这里 下载修改过的 SearchAction.java 和 SearchAction.class。 把 SearchAction.class 放到 pebble.jar 里面。 重启 Tomcat,应该可以中文搜索了。 看了源文件后,明白了乱码原来是由于在 Tomcat 5 下面当 GET 的时候 setCharacterEncoding 不起作用导致的。patch 就是加上了: if("GET".equalsIgnoreCase(request.getMethod())){ try { query = new String(query.getBytes("ISO8859_1"), request.getCharacterEncoding()); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } 把搜索词重新编码就可以了。 注意,Analyzer 还是使用标准的就可以了,不用换作 CJKAnalyzer。 这个 blog 对其它版本 pebble 的搜索问题有详细的解决方法好像。(是日文的,不过差不多能猜出来意思) ant21 @ 20:55 | 阅读全文 | 评论 0 | 引用 0 | 编辑 2005-07-01 Pebble on Tomcat 5 TAG: Java_Things 发现 Pebble 在 Tomcat 5 下面搜索又变成乱码了!郁闷啊!在 Tomcat 4 下面都好好的嘛,中文显示和搜索都调好了,可一换到 5 下面怎么不行了呢? 在作者的 blog 上面,看到他说的: I've not tried any of the JSP 2.0 containers because that's just going to open up a whole can of worms! On the other hand, I've just downloaded Resin 2.1.12 and installed Pebble. No problems for me. ;-) 不过那是 2004 年的事情了。不管怎么说,还是自己慢慢调吧。在 Tomcat 4 下面, Pebble 1.8 的主要设置是: Time zone: Asia/Chongqing Character encoding: UTF-8 Lucene Analyzer: org.apache.lucene.analysis.standard.StandardAnalyzer 我在这样的配置下中文显示和搜索都没有问题。 ant21 @ 15:52 | 阅读全文 | 评论 0 | 引用 0 | 编辑 分页 : 访问统计: