webwork

Configure velocity to render an object with something other than toString?

回眸只為那壹抹淺笑 提交于 2019-12-24 10:39:37
问题 Is there a way to configure Velocity to use something other than toString() to convert an object to a string in a template? For example, suppose I'm using a simple date class with a format() method, and I use the same format every time. If all of my velocity code looks like this: $someDate.format('M-D-yyyy') is there some configuration I could add that would let me just say $someDate instead? (Assuming I'm not in a position to just edit the date class and give it an appropriate toString()). I

Atlassian JIRA Plugin Development: How to make variables available to velocity templates

Deadly 提交于 2019-12-19 14:37:23
问题 FAIR WARNING: this question is going to be pretty tough to answer unless you have experience with JIRA and have access to their source (enterprise users). Greetings all, I am writing a plugin which extends AbstractIssueSelectAction. I noticed that ${issue.summary} , etc are all available from within my velocity template, however, there are other things I wish to expose. I can't figure out how to add other things to the velocity parameter map. I even used a remote debugger to try to step

WEB-WORKER进阶学习(二)

允我心安 提交于 2019-12-18 15:59:04
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 由于JS单线程模型的原因,虽然可以通过异步来处理请求。但是最终还是需要由主线成处理 出于希望将渲染 / (请求、计算) 解耦的想法,所以对现在由axios构建的api请求层做改造,所有的数据请求交予web-work处理。达到渲染与请求分开的目的 问题 同时存在多少个Worker比较合适 ? 理论上worker没有上限,开启多少个都可以,根据实际情况即可。不建议按照CPU( navigator.hardwareConcurrency )核心数开启对应的数量 像目前做的请求/渲染分离就是开启4个作为守护线程。因为除了IE6,7最少支持4个并发请求 多个Worker如何协同工作 ? 需要考虑开启多个worker的统一调配的问题,与负载均衡的问题。 开启的worker可以通过数组存储 负载均衡可以使用轮询,最有可用等算法来处理 消息该如何处理 ? 与axios不同的是,worker处理请求跨越不同的线程,真正的实现异步的请求。那如何保证正确的触发回调 内部通过Promise构建,返回调用者Promise对象,同时为任务分配唯一ID。将任务ID, resolve,reject 同时存储记录 worker将返回数据/异常与接受到的任务ID一并打包返回 通过任务ID将任务从任务池中pop出,执行对应的回调 请求使用什么技术?

Struts 2 - The usage of %{ } notation

此生再无相见时 提交于 2019-12-18 05:17:20
问题 What is the exact use of %{} notation in Struts 2? Can someone explain with a simple example where the code works when %{} is used and does not works when its not used? 回答1: Used in OGNL to force evaluate the content in brackets as OGNL expression. For example <s:iterator value = "myAnswers" status="stat"> <s:textfield name = "myAnswers[%{#stat.index}].name"/> evaluation of the stat.index should be forced. 来源: https://stackoverflow.com/questions/18491659/struts-2-the-usage-of-notation

Atlassian JIRA Plugin Development: How to make variables available to velocity templates

北慕城南 提交于 2019-12-01 16:43:55
FAIR WARNING: this question is going to be pretty tough to answer unless you have experience with JIRA and have access to their source (enterprise users). Greetings all, I am writing a plugin which extends AbstractIssueSelectAction. I noticed that ${issue.summary} , etc are all available from within my velocity template, however, there are other things I wish to expose. I can't figure out how to add other things to the velocity parameter map. I even used a remote debugger to try to step through the stack and figure out what is going on - but it was pretty unclear to me both due to a deep stack

Struts 2 - The usage of %{ } notation

泄露秘密 提交于 2019-11-29 08:03:42
What is the exact use of %{} notation in Struts 2? Can someone explain with a simple example where the code works when %{} is used and does not works when its not used? Used in OGNL to force evaluate the content in brackets as OGNL expression. For example <s:iterator value = "myAnswers" status="stat"> <s:textfield name = "myAnswers[%{#stat.index}].name"/> evaluation of the stat.index should be forced. 来源: https://stackoverflow.com/questions/18491659/struts-2-the-usage-of-notation