开发者

access javascript variable in java

开发者 https://www.devze.com 2023-01-03 10:46 出处:网络
function test(custId){ List<Account> list=开发者_C百科accountDelegate.findAccountEntityByGroupId((long)%>
function test(custId){
    List<Account> list=开发者_C百科accountDelegate.findAccountEntityByGroupId((long)%>
        custId<%)%>;
    <script>
}

Here my question is how to send custId to java method as parameter from Javascript? Where java method takes long argument.


You need to define if you are passing to a JSP page, or an Applet.

Some information on passing variables via applet:

  1. http://www.rgagnon.com/javadetails/java-0183.html
  2. http://www.daniweb.com/forums/thread93030.html

Apparently it's not possible to go Javascript to Java, unless you use querystring/cookies, things like that. Same applies with JSP pages, because there is a distinction between client side and server side, you will need to design your application so it utilises cookies/querystring/form values to achieve this.

0

精彩评论

暂无评论...
验证码 换一张
取 消