bbossgroups 3.3 发布
bbossgroups 3.3 发布,该版本在3.2的基础上做了非常多的功能增强和功能改进,具体情况参考后面的功能点清单。
项目博客:
http://yin-bp.iteye.com/
项目sourceforge下载地址:
http://sourceforge.net/projects/bboss/files/
项目官网:
http://www.bbossgroups.com
release version : bbossgroups-3.3
release date: 2011/08/14
********************************************************
release futures:
************************************************bbossgroups-3.3******************************
1.aop/ioc
◆ 增加netty协议消息大小配置参数,解决发送/接收的数据报文超过默认1M时传输失败的问题
<!-- 能够解码的最大数据size,超过时,将抛异常,默认20M --><property name="maxFramgeLength_" value="20971520" /><!-- 编码块大小 --><property name="estimatedLength_" value="1024" />
public String uploadFileWithMultipartFile(@RequestParam(name="upload1") MultipartFile file, ModelMap model) public String uploadFileWithMultipartFiles(@RequestParam(name="upload1") MultipartFile[] files, ModelMap model)
public class FileBean { private MultipartFile upload1; @RequestParam(name="upload1") private MultipartFile[] uploads; @RequestParam(name="upload1") private MultipartFile anupload; //省略属性的get/set方法 }
<property value="/login.jsp"/> <property name="directtype" value="forward"/> </property>
sqlparams.addSQLParam("FILECONTENT", multipartfile,SQLParams.BLOBFILE);//直接传递MultipartFile对象进行插入 sqlparams.addSQLParam("FILECONTENT", inputStream, size,SQLParams.BLOBFILE);//直接传递InputStream对象以及流大小Size属性进行插入
public File getDownloadClobFile(String fileid) throws Exception { try { return SQLExecutor.queryTField( File.class, new FieldRowHandler<File>() { @Override public File handleField( Record record) throws Exception { // 定义文件对象 File f = new File("d:/",record.getString("filename")); // 如果文件已经存在则直接返回f if (f.exists()) return f; // 将blob中的文件内容存储到文件中 record.getFile("filecontent",f); return f; } }, "select * from CLOBFILE where fileid=?", fileid); } catch (Exception e) { throw e; } }
public boolean uploadFile(InputStream inputStream,long size, String filename) throws Exception { boolean result = true; String sql = ""; try { sql = "INSERT INTO filetable (FILENAME,FILECONTENT,fileid,FILESIZE) VALUES(#[filename],#[FILECONTENT],#[FILEID],#[FILESIZE])"; SQLParams sqlparams = new SQLParams(); sqlparams.addSQLParam("filename", filename, SQLParams.STRING); sqlparams.addSQLParam("FILECONTENT", inputStream, size,SQLParams.BLOBFILE); sqlparams.addSQLParam("FILEID", UUID.randomUUID().toString(),SQLParams.STRING); sqlparams.addSQLParam("FILESIZE", size,SQLParams.LONG); SQLExecutor.insertBean(sql, sqlparams); } catch (Exception ex) { ex.printStackTrace(); result = false; throw new Exception("上传附件关联临控指令布控信息附件失败:" + ex); } finally { if(inputStream != null){ inputStream.close(); } } return result; }
SQLExecutor.queryByNullRowHandler(new NullRowHandler(){ @Override public void handleRow(Record record) throws Exception { record.getBlob("filecontent").getBinaryStream(); StringUtil.sendFile(request, response, record.getString("filename"),record.getBlob("filecontent")); }}, "select * from filetable where fileid=?",fileid);
<table> <h3>map<String,po>对象信息迭代功能</h3> <pg:map requestKey="mapbeans"> <tr /> </td> <td> name:<pg:cell colName="name" /> </td> </tr> </pg:map> </table> <table> <h3>map<String,String>字符串信息迭代功能</h3> <pg:map requestKey="mapstrings"> <tr name="code"> StringUtil.sendFile(request, response, record .getString("filename"), record .getBlob("filecontent")); StringUtil.sendFile(request, response, file);