servlets - how to properly call a java function from a ftl file in ofbiz? -
i think have done necessary splicing me allow gui invoke java method.
this ftl file process should start, on widget screens xml file , displaying contents i'm not sure of parameters used here proper call java class
<form action="<@ofbizurl>methodtoinvoke</@ofbizurl>" method="post"> <input type="submit" value="id"></input> <input type="text" name="input"></input> </form>
and code on 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 run application , hit button, address on browser looks trying call method nothing seems happen. should download file user , have done setup on java method such reponse headers , file needs written on it.
when click on it not , goes same page.
with ofbiz controllers, can send response in 2 ways:
- preffered more common way: in java event call services, or processing, result of processing request attribute, , render these attributes in view. can see, controller points view.
- this less common case, when need send user data, cannot rendered in view, in case, manually write data in response object, , close reponse stream. assume doing that. in case should not return view in controller, because have written data , closed response stream. change controller this:
<response name="success" type="none" />
Comments
Post a Comment