Pass Javascript Value to Java in JSP

前端 未结 2 564
渐次进展
渐次进展 2020-12-11 23:45

I would like to pass a Javascript value to a Java function in JSP. How can I do that? The id comes from a combobox in JSP via Javascript. I will get the ID from ComboBox and

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-12 00:13

    Javascript statements are rendered by Browsers and executed as client program.

    In your case if you want execute a java code based on selection of html component, you would need to use ajax call .

    You can find quick example here

    A Simple AJAX with JSP example

    http://www.programming-free.com/2013/03/ajax-fetch-data-from-database-in-jsp.html

提交回复
热议问题