Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JSP Interest »

Re: Function call using variables

Arasu, Sabari

2005-04-08


One option is to use reflection API though its costly.

Regards,
Sabari Arasu
AIG Refe
Jersey City, New Jersey


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:JSP-INTEREST@(protected)
Sent: Friday, April 08, 2005 1:55 AM
To: JSP-INTEREST@(protected)
Subject: Function call using variables

I am trying to call a Java Bean function from my JSP. I need to call this
dynamically. Would appreciate any inputs.

Here is what I am trying to do :

<%
 String temp = "FunctionName()"; // Ofcourse what I am doing is not this
straight forward but I would eventually have a string that is a function
name similar to this.
%>
 <TD><%=temp%></TD> -This, I know is wrong since it would print the
string. But what I would like it to do is call the function FunctionName
(). I need it to do something similar to eval. Any inputs on the approach
please?

Thanks,
Prat

===========================================================================
To unsubscribe: mailto listserv@(protected)
JSP-INTEREST".
For digest: mailto listserv@(protected)
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto listserv@(protected)".
For digest: mailto listserv@(protected)".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com
©2008 junlu.com - Jax Systems, LLC, U.S.A.