struts 让浏览器提示文件下载,而不是显示文件的内容

摘要: struts.xml 方式配置 <action name="Download" class="xx.action.DownLoad"> <result type="stream" name="success"> <param name="inputName">inputStream</param> <param name="contentType">application/octet-stream</param 阅读全文
posted @ 2012-04-18 14:19 hui_ 阅读(141) 评论(0) 推荐(0)

tomcat 下载文件中文命名问题

摘要: 当用中文命名的文件 下载文件地址变成乱码http://localhost:8080/%E4%B8%AD%E6%96%87.rar修改 tomcat(目录)/conf/server.xml <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />to: <Connector port="8080" protocol="HTTP/1.1" 阅读全文
posted @ 2012-03-21 16:01 hui_ 阅读(274) 评论(0) 推荐(0)

上传图片预览

摘要: Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head> <meta http-equiv="Content-Type" content="text/html; chars 阅读全文
posted @ 2012-03-20 17:55 hui_ 阅读(308) 评论(0) 推荐(0)

jxls java excel templates tools

摘要: website:http://jxls.sourceforge.net/Reader: example: InputStream xis = new FileInputStream(file);Workbook wk = Workbook.getWorkbook(xis);Sheet sheets = wk.getSheet(0);// 获得总 Sheetsint rows = sheets.getRows();for (int i = 0; i < rows; i++) { Cell[] cell_domain = sheets.getRow(i); // 获取第i行 所有列形成... 阅读全文
posted @ 2012-03-14 11:39 hui_ 阅读(471) 评论(0) 推荐(0)

Spring @Transaction Propagation 详解

摘要: REQUIRED:业务方法需要在一个事务中运行。如果方法运行时,已经处在一个事务中,那么加入到该事务,否则为自己创建一个新的事务。(基本在我们应用开发中,80%是使用这种事务传播行为。在没有标注的操作中,默认是这种行为)NOT_SUPPORTED:声明方法不需要事务。如果方法没有关联到一个事务,容器不会为它开启事务。如果方法在一个事务中被调用,该事务会被挂起,在方法调用结束后,原先的事务便会恢复执行。REQUIRESNEW:属性表明不管是否存在事务,业务方法总会为自己发起一个新的事务。如果方法已经运行在一个事务中,则原有事务会被挂起,新的事务会被创建,直到方法执行结束,新事务才算结束,原先的事 阅读全文
posted @ 2012-03-14 10:54 hui_ 阅读(950) 评论(0) 推荐(0)

Not connected to a cassandra instance 解决方法

摘要: 1、用命令窗口打开cassandra-cli.bat文件\apache-cassandra-1.0.2\bin>cassandra-cli -host localhost -port 91602、双击打开cassandra-cli.bat文件输入connect localhost/9160链接http://www.divconq.com/2010/installing-and-running-the-cassandra-database/ 阅读全文
posted @ 2011-11-16 01:21 hui_ 阅读(488) 评论(0) 推荐(0)

学习Cassandra的网站

摘要: http://www.datastax.com/docs/1.0/index 阅读全文
posted @ 2011-11-07 17:15 hui_ 阅读(115) 评论(0) 推荐(0)