如何从ofbiz的ftl文件中正确调用Java函数? [英] how to properly call a java function from a ftl file in ofbiz?
问题描述
我认为我已经完成了必要的拼接,以允许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函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!