Tag: 速度

Atlassian JIRA插件开发:如何使变量可用于速度模板

公平警告:除非您有使用JIRA的经验并且可以访问其源(企业用户),否则这个问题将很难回答。 问候所有, 我正在编写一个扩展AbstractIssueSelectAction的插件。 我注意到${issue.summary}等都可以从我的力度模板中获得,但是,还有其他我希望公开的内容。 我无法弄清楚如何将其他东西添加到速度参数图中。 我甚至使用了一个远程调试器来尝试逐步完成堆栈并弄清楚发生了什么 – 但由于深度堆栈以及我无法正确附加所有源的事实,我很不清楚(很多网络工作似乎都被混淆了)。 我也在Atlassian支持论坛上发布了这个问题,我只是在这里交叉发帖以更多地关注这个问题。 示例操作代码: public class MyOperation extends AbstractIssueSelectAction { // … private final Issue myIssue; public String doCollect() throws Exception { log.debug(“Running doCollect()”); return “collectinfo”; } } 示例插件配置: /templates/myoperation-collectinfo.vm /templates/myoperation-success.vm 在速度模板中, ${issue.summary}正确解析为当前问题的摘要,但如果myIssue是其他问题,例如,我希望能够使用${myIssue.summary} 。 谢谢! -Carl

如何在速度模板中包含jsp页面?

在我的项目中,我在jsp中有我的页眉和页脚,我想将这些页眉和页脚添加到现有项目中,页眉和页脚在速度模板(.vm)中 请帮帮我……提前谢谢……

如何使弹跳球更快移动? 动态速度?

所以我现在有一个程序可以使用JavaFX在屏幕上移动一个弹跳球,现在我已经尝试在我的时间轴动画中重新格式化Duration.millis()下的某些值,并且我把它放得越快,但是,有人有告诉我这不是最好的方式,我应该问一下动态速度添加到我的程序这里是我的球运动代码: public class BallPane extends Pane { public final double radius = 5; public double x = radius, y = radius; public double dx = 1, dy = 1; public Circle circle = new Circle(x, y, radius); public Timeline animation; public BallPane(){ circle.setFill(Color.BLACK); // Set ball color getChildren().add(circle); // Place ball into Pane // Create […]

使用spring security时如何在速度宏中获取csrf令牌

我正在尝试为启用spring web security的应用程序创建自定义登录屏幕,我无法弄清楚如何将csrf标记传递给velocity(不,我目前无法使用JSP)。 该模型看起来像这样: @RequestMapping(value = “/login”, method = RequestMethod.GET) public ModelAndView login( @RequestParam(value = “error”, required = false) String error, @RequestParam(value = “logout”, required = false) String logout ModelAndView model = new ModelAndView(); if (error != null) { model.addObject(“error”, “Invalid username or password!”); } if (logout != null) { model.addObject(“msg”, “You’ve been logged out […]

如何在速度模板中检索hashmap值

如何从速度模板中的以下hashmap中检索值? 请帮忙.. LinkedHashMap<String, LinkedHashMap> hashmap = new LinkedHashMap<String, LinkedHashMap>();

如何将速度模板加载到EJB中以用作邮件模板

我有一个Java EE 6应用程序,我想在其中使用velocity从模板生成邮件。 我有一个@Named bean,负责加载和填充特定模板。 该项目是一个Web应用程序,所以我将我的模板放入WEB-INF / classes(这看起来相当丑陋,但我现在没有找到更优雅的解决方案)并使用ClasspathResourceLoader来访问文件。 配置如下: Properties props = new Properties(); props.setProperty(“resource.loader”, “class”); props.setProperty(“resource.loader.class”, “org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader”); VelocityEngine engine = new VelocityEngine(props); VelocityContext context = new VelocityContext(); engine.init(); context.put(“myObject”, myObject); Template template = engine.getTemplate(“mail_template.vm”); StringWriter writer = new StringWriter(); template.merge(context, writer); 运行此代码会产生以下exception: Caused by: java.lang.UnsupportedOperationException: Could not retrieve ServletContext from application attributes at org.apache.velocity.runtime.log.ServletLogChute.init(ServletLogChute.java:73) […]

VelocityEngineUtils已经在Spring 3.2中删除了,还有什么可以使用的?

今天我将整个Spring Web应用程序从使用Spring 3.1.1升级到Spring 3.2 。 除了在Spring 3.2 ,我的现有应用程序的大多数部分都没有破坏 org.springframework.ui.velocity.VelocityEngineUtils class似乎完全从spring-context-3.2.0.RELEASE.jar中删除 。 我在此url中找到了迁移指南。 它声明org.springframework.ui.velocity.VelocityEngineUtils类刚刚被弃用,但事实上它已被完全删除。 也许我只是错了,我想知道VelocityEngineUtils类是否仍然存在于某个地方或者如果没有,我可以使用的替代类是什么。 编辑:似乎整个速度包已从Spring 3.2删除,所以现在甚至org.springframework.ui.velocity.VelocityEngineFactoryBean都不存在。 spring是否会离开Velocity?

为什么在Spring 4.3中不推荐使用Velocity支持?

我们如何在Spring 5.0之后使用Velocity和Spring?

如何禁用速度日志

我一直试图禁用Velocity日志,到目前为止我发现的唯一方法是积极的结果是设置: runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogSystem 但是在velocity.jar里面的velocity.properties里面。 我在Web应用程序(tomcat)上下文中使用velocity。 有没有办法禁用速度(通过设置以前的属性或其他)但不修改JAR? 无法修改任何CODE 提前致谢

从Apache Velocity模板访问常量值?

是否可以从Velocity模板访问常量值(即Java类中定义的公共静态最终变量)? 我希望能够写出这样的东西: #if ($a lt Long.MAX_VALUE) 但这显然不是正确的语法。