Hi,
I would like to find out how to call javabean from jsp page with passing values upon onChange event. Pls provide example if possible

cal ur jsp using a javascript ,cal that script upon onChange u can write ur bean cals in that JSP

cal ur jsp using a javascript ,cal that script upon onChange u can write ur bean cals in that JSP

Can you give a simple example?

onChange="javascript: return calBeanFucntion('yourJsp.jsp');

onChange="javascript: return calBeanFucntion('yourJsp.jsp');

He there!

Shyam I can't see what are you trying to do. Which code do you plan to place in the function "calBeanFunction()"?

In my case, what I need to do is execute a JavaBean each time I catch a Javascript event and I'm really lost to do so. Could you please give a bit of light, please?

Cheers!

You can't execute Java code from a Javascript function directly.
All you can do is have the Javascript generate an Http request to a servlet which can execute the Java code for you and optionally return something which your Javascript could then use to generate content for your page.

It is tricky, but it can be done. Can't tell you how we solved it as the code is not mine to give away.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.