前台JSP:<script type="text/javascript">
function test1(r){
acl.testHello(
r.userId,
r.checked
);
}
</script>
.....
<input userId="123" type="checkbox" onclick="test1(this)" >做了一个测试方法:public void testHello(int userId, boolean yes) {
System.out.println(" userId="+ userId +",yes=" + yes);
}
其他配置文件都没问题,
现在问题是:每次点击checkbox页面都会弹出Error消息框,后台一点错误信息都没有。
如果改为没有参数的方法,则可以连接到实现类方法。希望N人能帮帮忙。
function test1(r){
acl.testHello(
r.userId,
r.checked
);
}
</script>
.....
<input userId="123" type="checkbox" onclick="test1(this)" >做了一个测试方法:public void testHello(int userId, boolean yes) {
System.out.println(" userId="+ userId +",yes=" + yes);
}
其他配置文件都没问题,
现在问题是:每次点击checkbox页面都会弹出Error消息框,后台一点错误信息都没有。
如果改为没有参数的方法,则可以连接到实现类方法。希望N人能帮帮忙。
http://localhost:8080/项目名/dwr 这个页面 就可以直接测试了
你这个提供信息太少了!
问题现在我解决了 。谢谢各位。
应该是浏览器的问题。
我将取值方法改为这样r.getAttribute("userId")就可以了。
但还没有搞懂 为什么不能用r.userId这样取值