如何从ofbiz的ftl文件中正确调用java函数?(how to properly call a java function from a ftl file in ofbiz?)
我想我已经为我做了必要的拼接,允许gui调用java方法。
这是我的ftl文件,其中进程应该开始,这是在小部件屏幕xml文件上,它正确显示内容,但我只是不确定我在这里用来正确调用java类的参数
<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方法的设置,例如响应头和需要在其上写的文件。
当我点击它时它并没有真正做任何事情,它只是回到同一页面。
I think I have already done the necessary splicing for me to allow the gui to invoke a java method.
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>
and this is the code on my controller
<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>
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.
原文:https://stackoverflow.com/questions/15740641
最满意答案
在END语句之前我错过了分号。
DELIMITER $$ USE woodsweb$$ CREATE PROCEDURE CreateNewSession ( IN p_IPAddress VARCHAR(20) ) BEGIN INSERT INTO SessionLog (IPAddress) VALUES (p_IPAddress); SELECT last_inserted_id(); END$$
注意添加
;
在SELECT last_inserted_id()之后I was missing the semicolon BEFORE the END statement.
DELIMITER $$ USE woodsweb$$ CREATE PROCEDURE CreateNewSession ( IN p_IPAddress VARCHAR(20) ) BEGIN INSERT INTO SessionLog (IPAddress) VALUES (p_IPAddress); SELECT last_inserted_id(); END$$
Note the added
;
after SELECT last_inserted_id()
相关问答
更多-
有什么数据库专业书籍介绍?[2022-05-19]
mysql -
mysql INSERT INTO语法错误 - 新用户:) [重复](mysql INSERT INTO syntax error - Newish User:) [duplicate])[2021-12-06]
用下面的单引号括起你的文本/字符串值。 INSERT INTO company (company, adr_street, city, Prov, postal, country) VALUES ('company1', '67 46 street sw', 'city1', 'province1', 'w9w9w9', 'Canada'); Wrap your text/string values with single quote like below. INSERT INTO company (c ... -
再次是你:)类是否有一个Table("tbl_cause")指令? 在这里阅读dapper contrib扩展文档 It's you again :) Does the class Cause have a Table("tbl_cause") directive? Read the dapper contrib extensions documentation here
-
使用带有MySQL-Python的INSERT INTO语句的语法错误(Syntax error using INSERT INTO statement with MySQL-Python)[2022-05-10]
2件事。 我会从你的循环中取出if块并确保预先安装正确的SQL。 SQL3 = 'UPDATE table SET ' + " ".join(query) + ';' #don't forget WHERE clause as well... 或者如果您要插入...有效的INSERT语句 你在文件中遇到空行吗? 也许试试.... 而不是这个(在您的问题中没有正确格式化) for line in InFile: if LineNumber > 0: line = line.strip(" ... -
你错过了最后的结束) : mysql_query("INSERT INTO `tracks` (artistID, albumID, format, trackID, niceTitle, title, trackNumber, description, pictureURL, playCount) VALUES('$artistID', '$albumID[$i]', 'hq','$ID[0]', '$trackName', '$title', '$j', '$description', '$pictur ...
-
在END语句之前我错过了分号。 DELIMITER $$ USE woodsweb$$ CREATE PROCEDURE CreateNewSession ( IN p_IPAddress VARCHAR(20) ) BEGIN INSERT INTO SessionLog (IPAddress) VALUES (p_IPAddress); SELECT last_inserted_id(); END$$ 注意添加; 在SELECT last_inserted_id( ...
-
首先,只需正确输入INSERT 。 像这样使用_GET确实可以打开SQL INJECTIONS ... 看看MySQL准备的语句 。 命名您要插入数据的列也是一种很好的做法 。 这允许你在后面插入额外的列并保留应用程序逻辑。 INSERT INTO cos(rowName1, rowName2) VALUES(?, ?) 哪里? 将准备好陈述。 First and foremost, just type INSERT correctly. Using _GET like that really opens ...
-
您的INSERT在语法上不正确。 即使你修复它,你的INSERT将无法工作,因为你正在选择并插入到同一个表中! 这在mysql中是不允许的。 您将需要使用更新。 con.prepareStatement("UPDATE login SET ipaddress = ? WHERE user=? and password=?"); Your INSERT is not syntactically correct. Even when you fix it your INSERT will not work b ...
-
JavaFX Textfield到MySQL INSERT:SQL语法错误(JavaFX Textfield to MySQL INSERT: SQL Syntax Error)[2023-05-23]
conn = DBConnect.Connector(); stmt = conn.createStatement(); stmt.executeUpdate("INSERT INTO shopList (name,address,city,state,country,zipcode,phonefull) VALUES('" +name+ "','" + address + "','" + city + "','" + state + "','" + country + "','" + zip + "',' ... -
where子句不是Insert语句的一部分。 你不能INSERT ...在哪里 Where clauses are not part of the Insert statements. You cannot INSERT...WHERE