Calling a java method in ajax

后端 未结 2 1891
醉酒成梦
醉酒成梦 2020-12-05 06:00

I am creating a jsp application in Netbeans Ide. I am having problems in calling a java class method in ajax.Is it possible to do so

My java class is something like

2条回答
  •  一生所求
    2020-12-05 06:29

    You cannot call the method directly. You should map an URL to the method you want to call. This can be done in a servlet. If you're already serving pages through your Java code, you just add a new method to serve a page with the content you want.

提交回复
热议问题