Calling Java inside JavaScript Function

后端 未结 8 1001
时光取名叫无心
时光取名叫无心 2020-12-04 02:26

Please tell me if we can call java inside javascript function ?


    

        
8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 02:53

    You can. In JSF you can use PrimeFaces' component p:remoteCommand, which would contain action method. Call that remoteCommand by its name from JS and the java method will get executed.

    JSF Page

         
    

    In JavaScript

        function callJava {rmt();}
    

提交回复
热议问题