File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need to invoke a java function by passing a parameter