小编Som*_*iks的帖子

访问JSR-356 @ServerEndpoint的@OnMessage中的ServletContext和HttpSession

我需要ServletContext从内部获取@ServerEndpoint,以便找到Spring ApplicationContext并查找Bean.

目前我最好的方法是在JNDI命名上下文中绑定该bean并在其中查找它Endpoint.欢迎任何更好的解决方案.

我也在寻找一种合理的方法来将servlet HttpSession与websocket 同步Session.

servlets java-ee httpsession websocket java-websocket

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

如何禁用apexcharts的下载选项?

我正在使用apexcharts vue绑定来绘制一些条形图。

至于说通过文档应该可以禁用通过设置显示工具栏:假所看到那里

所以我做到了我的助手功能:

// do-char-options.js
const randomColor = require("randomcolor");
module.exports = labels => ({
  toolbar: { show:false },// docs says it should do the trick
  colors: randomColor({
    luminosity: "light",
    hue: "blue",
    count: 30
  }),
  plotOptions: {
    bar: { distributed: true, horizontal: true }
  },
  tooltip: {
    theme: "dark"
  },
  xaxis: {
    categories: labels,
    color: "white",
    labels: {
      style: {
        colors: ["white"]
      }
    }
  },
  yaxis: {
    labels: {
      style: {
        color: "white"
      }
    }
  } …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js apexcharts

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

如何在 Javalin 上配置默认的 Jackson JSON Mapper

到目前为止,我找到了如何替换 Javalin json 映射器:

https://javalin.io/documentation#configuring-the-json-mapper

但我不想替换它,只是想添加一些 jackson 模块,例如:

https://www.ktorm.org/api-docs/org.ktorm.jackson/-ktorm-module/index.html

如果没有这个,Javalin 无法序列化 ktorm 实体,示例代码在这里

json kotlin javalin ktorm

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