*
The moose likes Struts and the fly likes need to invoke a java function by passing a parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "need to invoke a java function by passing a parameter" Watch "need to invoke a java function by passing a parameter" New topic
Author

need to invoke a java function by passing a parameter

ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
Hi

i have scriptlet that actually invokes a java functions by passing an argument.
I want to replace the scriplet with a struts2 tag.
I know that i can invoke a method like this way ex:<s:property value="display()"/> where display() is a method from an object which is in the valuestack.
how can i pass an argument(not hardcoded constant) to the display() function.
Can i have something like <s:property value="display('<s:property value="getName()"/>')"/>

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No, you can't arbitrarily nest custom tags.

OGNL expressions may contain anything, however, like "display(name)". The OGNL documentation may be of interest.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: need to invoke a java function by passing a parameter
 
Similar Threads
Need to create dynamic <s:property tag using <s:iterator
struts2 + display tags + maps
Passing String array as argument to main() method
iterate an object in struts-2
object refference