如何从ofbiz的ftl文件中正确调用Java函数?

编程入门 行业动态 更新时间:2024-10-23 17:32:41
本文介绍了如何从ofbiz的ftl文件中正确调用Java函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我认为我已经完成了必要的拼接,以允许gui调用Java方法.

I think I have already done the necessary splicing for me to allow the gui to invoke a java method.

这是我的ftl文件,应在该文件中开始该过程,该文件位于小部件屏幕的xml文件中,并且可以正确显示内容,但我不确定我在此处用于正确调用该文件的参数Java类

This is my ftl file where the process should start, this is on a widget screens xml file and it is properly displaying the contents but i'm just not sure of the parameters that I used here to do a proper call to the java class

<form action="<@ofbizUrl>methodToInvoke</@ofbizUrl>" method="POST"> <input type="submit" value="id"></input> <input type="text" name="input"></input> </form>

这是我控制器上的代码

<request-map uri="methodToInvoke"> <security https="true" auth="true"/> <event type="java" path="com.report.SomeClass" invoke="methodToInvoke"/> <response name="success" type="view" value="reports" /> <response name="error" type="view" value="reports" /> </request-map>

当我运行该应用程序并按下按钮时,浏览器上的地址似乎正在尝试调用该方法,但似乎没有任何反应.它应该将文件下载给用户,并且我已经在java方法上完成了设置,例如响应标头和需要写入的文件.

When I run the application and I hit the button, the address on my browser looks to be trying to call the method but nothing seems to happen. it should download a file to the user and I have already done the setup on the java method such as the reponse headers and the file that needs to be written on it.

当我单击它时,它实际上并没有执行任何操作,只是返回到同一页面.

When I click on it it does not really do anything and it just goes back to the same page.

推荐答案

我无法特定地构建应用程序的buildfile,因为我只是在整个biz中使用build.xml,而且似乎并没有更新对我正在使用的应用程序进行修改.

I was not able to build the buildfile of the applcation SPECIFICALLY because I was just using the build.xml for the whole ofbiz and that does not seem to update the modifications on the application that I am using.

这样做之后,我在java类上所做的更改就起作用了

After doing that, the changes that I made on the java class worked

更多推荐

如何从ofbiz的ftl文件中正确调用Java函数?

本文发布于:2023-11-26 20:16:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635041.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   正确   文件   ofbiz   ftl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!