javascript and java

How do you access dynamic data with javascript? I have a form which I would like filled from a java class on a button click. How would I use javascript to do this?
[170 byte] By [vinays84a] at [2007-11-26 15:05:17]
# 1

You can't make javascript access your class directly. The javascript invokes on the client while the class is in memory on your server. You'll need some sort of HTTP request to fetch the data from the server.

One popular way of doing it would be Ajax. On the button click using ajax invoke a servlet or jsp that outputs the data you want and then fill the form using javascript.

Another way would be to simply do a form submit on the button click and rebuild the page.

gimbal2a at 2007-7-8 8:55:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...