小编Dar*_*tel的帖子

如何从其Div ID中获取Ace Editor对象

我有一个div实例化ace编辑器对象.

我试图drag and drop从一个文本到它HTML draggable.

我已经制作了ui-ace div droppable并希望从drop的事件目标中获取编辑器的当前实例.

我该怎么做到这个???

HTML

<div id="id1" ui-ace droppable=true ondrop="handleDrop(event,this)"></div>
Run Code Online (Sandbox Code Playgroud)

JS功能

function handleDrop(e,obj){
   // need code to get current editor instance from obj without using ace.edit(obj.id)
   // because ace.edit(obj.id) will reset the content I believe. Please correct me if I am 
   //wrong. Ace api says it will insert editor in the DOM. http://ace.c9.io/#nav=api&api=ace
}
Run Code Online (Sandbox Code Playgroud)

请帮忙.

html javascript

9
推荐指数
1
解决办法
3366
查看次数

如何在Redis中存储嵌套的Hashmap?

我想将 netsted 存储HashMapRedis单个密钥中。

例如 :

HashMap<String, HashMap<String,String>> map = new  HashMap<>();
Run Code Online (Sandbox Code Playgroud)

请建议:

  • 有没有办法存储上述数据结构?
  • 我们怎样才能做到这一点?

java hashmap redis

6
推荐指数
1
解决办法
6128
查看次数

Wildfly 13 gzip 过滤器属性

早些时候我使用 Jboss 7.1,我在其中配置了 gzip 过滤器的以下属性,以便它提高我的产品性能。它工作正常。

<property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION" value="force"/>
<property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIME_TYPES" value="text/javascript,text/css,text/html"/>
<property name="org.apache.coyote.http11.Http11Protocol.COMPRESSION_MIN_SIZE" value="1000"/>
Run Code Online (Sandbox Code Playgroud)

现在,我最近迁移到 Wildfly 13,我认为,这些属性不起作用。所以,你能帮我解决这个问题吗?

另外,是否还有其他重要的配置可以提高 Wildfly 的性能?

java jboss application-server wildfly

3
推荐指数
1
解决办法
2023
查看次数

配置/增加MongoDB shell历史记录长度

我想看看MongoDB shell的历史.我在谷歌搜索然后我发现所有的shell历史都存储在.dbshell文件中.

1)是否有任何命令或棘手的方法来查看MongoDB Shell中的MongoDB Shell历史记录?

2)什么是默认的MongoDB shell历史长度???

3)如何配置/增加MongoDB shell的历史长度?

shell mongodb windows-8.1

2
推荐指数
1
解决办法
348
查看次数

Postgres:在多对多关系表中获取最小和最大行数

我有RFQ(报价请求)和供应商的出价金额的映射表.

rfq_vendor_mapping:

id  rfq_id(FK)  vendor_id(FK)   amount
---------------------------------------

 1      1           1            100
 2      1           2            50
 3      2           1            200
 4      2           3            300
 5      2           2            40
 6      3           4            70
 7      3           1            90
 8      3           2            250
 9      4           3            30
 10     5           1            500
Run Code Online (Sandbox Code Playgroud)

在上表中,我想分析供应商为每个RFQ提交最低和最高出价的次数.

预期产出:

vendor_id   min_bid_count   max_bid_count
-----------------------------------------
    1           1               2
    2           2               1
    3           1               2
    4           1               0
Run Code Online (Sandbox Code Playgroud)

http://sqlfiddle.com/#!15/60198/1

sql postgresql hibernate ejb jpa

2
推荐指数
1
解决办法
124
查看次数

如何在 formData 中追加数组,其中包含 2 个带有键的值

代码 :

let options = new RequestOptions({ headers: headers });
let array1;

array1 = [{ "subfolder_name": subfolder, "file_upload": file }];
let formData: FormData = new FormData();
formData.append("folder_name",folder );
formData.append("counselor",array1 );
Run Code Online (Sandbox Code Playgroud)

它返回辅导员:[Object Object]

javascript multipartform-data angularjs

2
推荐指数
1
解决办法
9519
查看次数

刷新 ServletOutputStream 时出现空指针异常

这是我在冲洗时遇到的一些例外情况ServletOutputStream。它不会出现在每个请求中,所以我无法重现它。

java.lang.NullPointerException
    at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:215)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
    at org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:119)
    at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:805)
    at org.apache.coyote.Response.action(Response.java:174)
    at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:366)
    at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:333)
    at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:101)
    at darshan.HttpRequestHandler.returnResponse(HttpRequester.java:117)
Run Code Online (Sandbox Code Playgroud)

HttpRequester.java :

private void returnResponse(HttpServletResponse response , String responseStr)
{
    InputStream in = null;
    ServletOutputStream out = null;
    try
    {
        in = new ByteArrayInputStream(responseStr.getBytes("UTF-8"));
        response.setContentLength(responseStr.length());
        out = response.getOutputStream();

        byte[] outputByte = new byte[4096];
        while(in.read(outputByte, 0, 4096) != -1)
        {
            out.write(outputByte, 0, 4096);
        }
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
    finally
    {
        try
        {
            in.close();
            out.flush();  //<-- Exception at …
Run Code Online (Sandbox Code Playgroud)

java servlets nullpointerexception jakarta-ee

1
推荐指数
1
解决办法
2847
查看次数