playframework中多附件上传注意事项
playframework中多附件上传注意事项
//play版本问题
经确认,1.0.3.2版本下控制器中方法参数 List<File> files 上传不同文件,获取到的都是第一个文件,坑爹啊,反正升级到1.2.3就没这个问题了.
//特容易忘记的关键就是这个enctype,附件上传需要他
#{form @@create(),enctype:'multipart/form-data'}
kindeditor-4.1.7编辑器的使用
需要引入的文件列表
/kindeditor-4.1.7/themes/default/default.css
/kindeditor-4.1.7/kindeditor-min.js
/kindeditor-4.1.7/lang/zh_CN.js"
调用
#{table.kindeditor "contentName",id:"contentID",value:contentValue ,height:"300px"/}
当然以上是在playframework中调用的自定义标签
路径/app/views/tags/table/kindeditor.html
内容如下
%{
name = _arg;
id = _id;
value = _value;
width = _width ? _width: "100%";
height= _height ? _height:"250px";
}%
<script type="text/javascript">
KindEditor.ready(function(K) {
var editor = K.create('#${id}', {
uploadJson : '/Kindeditor/upload',
fileManagerJson : '/Kindeditor/file_manager',
allowFileManager : true,
afterBlur: function(){this.sync();}
});
});
</script>
<textarea name="${name}" id="${id}" style="width: ${width};height: ${height};">${value}</textarea>