<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_kuku_分类_Java</title><id>http://feed.cnblogs.com/blog/u/7266/category/112959/rss</id><updated>2012-06-03T02:18:22Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kuku/category/112959.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/7266/category/112959/rss"/><entry><id>http://www.cnblogs.com/kuku/archive/2010/12/14/1905391.html</id><title type="text">JSP + STRUTS2 获取表单数据乱码</title><summary type="text">一个小程序写好了几次了，也测试了好多遍，但一直都没能输入中文，今天正式录入数据时，有中文了，一保存竟然乱码。这个问题以前也遇到过，一般使用过滤器或在页面中使用request.setCharacterEncoding("gb2312");来解决。今天在代码中加request.setCharacterEncoding("gb2312");后问题没有解决。印象中 STRUTS2 中有个配制编码的选项，网上搜索一下，问题解决：在 STRUTS.XML 文件中加入：&lt;constant name="struts.i18n.encoding" value="gb2312"/&gt;</summary><published>2010-12-14T04:04:00Z</published><updated>2010-12-14T04:04:00Z</updated><author><name>匡匡</name><uri>http://www.cnblogs.com/kuku/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kuku/archive/2010/12/14/1905391.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kuku/archive/2010/12/14/1905391.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/kuku/archive/2010/12/14/1905383.html</id><title type="text">新的 WINDOWS 2003 系统上装了 TOMCAT 6 启动不了</title><summary type="text">今天在一台新的机器上装了 JAVA7 和 TOMCAT 6，装好之后 TOMCAT 启动不了，感觉很奇怪，重启了系统也不行，然后看了一下启日志，说是什么找不到对应的模块[javajni.c]，至网上搜索了一下，搜到了挺多相关的信息。解决方法很简单，把 JAVA JDK 目录里的 BIN目录下面的 msvcr71.dll 文件复制到 SYSTEM32 目录下面就可以了。</summary><published>2010-12-14T03:58:00Z</published><updated>2010-12-14T03:58:00Z</updated><author><name>匡匡</name><uri>http://www.cnblogs.com/kuku/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kuku/archive/2010/12/14/1905383.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kuku/archive/2010/12/14/1905383.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/kuku/archive/2009/06/01/1493494.html</id><title type="text">(String) 和 String.valueOf() 两种字符串转换的区别</title><summary type="text">使用 String.valueOf() 进行数据转换，如果被转换的数据为 null, 则这种方法将返回一个 "null" 字符串（String） 方法进行转换时，如果被转换的数据为 null, 则返回 null 对象而不是一个 "null" 字符串。</summary><published>2009-06-01T02:45:00Z</published><updated>2009-06-01T02:45:00Z</updated><author><name>匡匡</name><uri>http://www.cnblogs.com/kuku/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kuku/archive/2009/06/01/1493494.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kuku/archive/2009/06/01/1493494.html"/><content type="text">使用 String.valueOf() 进行数据转换，如果被转换的数据为 null, 则这种方法将返回一个 "null" 字符串（String） 方法进行转换时，如果被转换的数据为 null, 则返回 null 对象而不是一个 "null" 字符串。</content></entry><entry><id>http://www.cnblogs.com/kuku/archive/2007/11/20/966115.html</id><title type="text">从一个数组中随机获取一些并不重复的数据</title><summary type="text">以前都是使用以下代码来实现这种功能的：int[] array1 = {1,2,3,4,5,6,7,8,9,0};int[] array2 = new int[5];int i = 0;while(i &lt; array2.length){ int index = (int)Math.random() * array1.length; int value = array1[index]; if(...</summary><published>2007-11-20T12:11:00Z</published><updated>2007-11-20T12:11:00Z</updated><author><name>匡匡</name><uri>http://www.cnblogs.com/kuku/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kuku/archive/2007/11/20/966115.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kuku/archive/2007/11/20/966115.html"/><content type="text">以前都是使用以下代码来实现这种功能的：int[] array1 = {1,2,3,4,5,6,7,8,9,0};int[] array2 = new int[5];int i = 0;while(i &lt; array2.length){ int index = (int)Math.random() * array1.length; int value = array1[index]; if(...</content></entry><entry><id>http://www.cnblogs.com/kuku/archive/2007/11/18/963434.html</id><title type="text">获取 JAVA 程序当前的工作目录</title><summary type="text">今天在写一个程序的时候，需要知道程序当前工作所在的目录，查找了一个 JAVA 类库，没有找到相应的方法，于是在网上找了一下，找了一种方法：File file = new File("t.tmp");String fullpath = file.getAbsolutePath();</summary><published>2007-11-18T12:44:00Z</published><updated>2007-11-18T12:44:00Z</updated><author><name>匡匡</name><uri>http://www.cnblogs.com/kuku/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kuku/archive/2007/11/18/963434.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kuku/archive/2007/11/18/963434.html"/><content type="text">今天在写一个程序的时候，需要知道程序当前工作所在的目录，查找了一个 JAVA 类库，没有找到相应的方法，于是在网上找了一下，找了一种方法：File file = new File("t.tmp");String fullpath = file.getAbsolutePath();</content></entry><entry><id>http://www.cnblogs.com/kuku/archive/2007/11/18/963424.html</id><title type="text">使用 Properties 为系统提供配制信息</title><summary type="text">在为系统提供一些配制信息的时候，以前都是使用 web.xml 文件的 context-param 标签来提供，从 web.xml 文件中读取 context-param 信息的时候，需要一个 HttpServletContext 对象，所以在需要从 web.xml 文件中读取信息的时候都需要一个 HttpServletContext 对象，这使我感觉有点麻烦。今天看了一下 Properties 类...</summary><published>2007-11-18T12:39:00Z</published><updated>2007-11-18T12:39:00Z</updated><author><name>匡匡</name><uri>http://www.cnblogs.com/kuku/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kuku/archive/2007/11/18/963424.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kuku/archive/2007/11/18/963424.html"/><content type="text">在为系统提供一些配制信息的时候，以前都是使用 web.xml 文件的 context-param 标签来提供，从 web.xml 文件中读取 context-param 信息的时候，需要一个 HttpServletContext 对象，所以在需要从 web.xml 文件中读取信息的时候都需要一个 HttpServletContext 对象，这使我感觉有点麻烦。今天看了一下 Properties 类...</content></entry></feed>
