开发者

Tapestry - Passing Parameters to method from tml

开发者 https://www.devze.com 2023-03-05 15:25 出处:网络
Is it possible to pa开发者_如何学Css a parameter to the method which is being defined in controller, and called by tml ?

Is it possible to pa开发者_如何学Css a parameter to the method which is being defined in controller, and called by tml ?

tml

${getDynamicFieldValue("Subject")}

java

public String getDynamicFieldValue(String fieldToCompare) 
{
    //Logic
}

Exception

Could not convert 'getDynamicFieldValue("Subject")' into a component parameter binding: Error parsing property expression 'getDynamicFieldValue("Subject")': Unable to parse input at character position 22.


Sure, it is possible. However, you must use single quotes around string literals:

${getDynamicFieldValue('Subject')}

Check the documentation for more information on property expressions.


Yes, it is possible to pass multiple arguments.

${getDynamicFieldValue('Subject', 'Object')}

where you have a method public String getDynamicFieldValue(String arg1, String arg2) ...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号