在JavaScript中想要调用Java的方法,我通过JavaScript访问servlet,再通过servlet调用Java某个类的方法。
HTML代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
< table id = "cartTable" > < thead > < tr > < th class = "product_remove" > < label > < input class = "check-all check" type = "checkbox" /> 全选 </ label > < a class = "fl delete" id = "deleteAll" href = "javascript:;" rel = "external nofollow" >< i class = "fa fa-trash-o" ></ i ></ a > </ th > < th class = "product_thumb" >图片</ th > < th class = "product_name" >名称</ th > < th class = "product-price" >价格</ th > < th class = "product_quantity" >款式</ th > </ tr > </ thead > < tbody > < tr > < td class = "product_remove" > < input class = "check-one check" type = "checkbox" /> </ td > < td class = "product_thumb" > < a href="ShopShoesDetails.jsp?shoes_id=<%=shoes.getShoes_id() %>" rel="external nofollow" rel="external nofollow" > < img src="${pageContext.request.contextPath}/ShopServlet? method = getShopsShoesImage &shoes_id=<%=shoes.getShoes_id() %>" id="codetool">
ShopShoesDao.java
ShopServlet.java
javascrip代码
以上就是JavaScript中如何调用Java方法的详细内容,更多关于js中调用Java方法的资料请关注服务器之家其它相关文章! 原文链接:https://www.cnblogs.com/qilin20/p/12459232.html 延伸 · 阅读
精彩推荐
|