Apr 6th, 2008 19:35
ha mo, Mark Pratt, Peter Whittaker,
I hope this is the answer you are looking for : the question isn't
clear to me.
The short answer is "You Can't" - the long answer goes like this.
A JSP, "Java Server Page", can basically be thought of as a HTML page
with embedded "bits of Java". When a client (a user with a web browser)
requests this JSP page for the first time, the JSP is compiled into a
JAVA Servlet. This JAVA servlet then "spits out" a static HTML page to
be displayed to the user. All objects including beans are only
available as this JAVA Servlet runs on the web server and creates the
HTML. They are not available on the client machine at all.
If you wish to extract a value from one of your beans and make it
var myValueExtractedFromMyBean = "<%myBean.getMyValue()%>" ;
as this arrives in your web page you will then have:
var myValueExtractedFromMyBean = "someValue" ;
Hope this helps,