dwr.jsp
<script src="/UploadFiles/2021-04-02/JUserChec.js"><script src="dwr/engine.js"><script src="/UploadFiles/2021-04-02/util.js"><script type="text/javascript">
function changeQx(p)
{
var val = p.value;
//alert(val);
JUserChec.jiLian(val, haschange);
}
function haschange(changeVal)
{
//alert(changeVal);
var jd = document.getElementById("jd");
var op = new Option(changeVal, changeVal);
jd.options.length=0;
jd.options.add(op);
}
</script>
<body>
<br><br>
<select onchange="changeQx(this)">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
</select>
<select id="jd">
</select>
</body>
dwr.xml
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE dwr
PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"
"http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<create creator="new" javascript="JUserChec">
<param name="class" value="com.struts.UserManager"/>
<include method="ccc"/>
<include method="jiLian"/>
</create>
</allow>
</dwr>
UserManager.java
package com.struts;
public class UserManager {
public boolean ccc(String uname){
if("abc".equals(uname)){
return true;
}
return false;
}
public String jiLian(String qx){
if("a".equals(qx)){
return "a1#a2#a3";
}
if("b".equals(qx)){
return "b1#b2#b3";
}
return "c1#c2";
}
}
<script src="/UploadFiles/2021-04-02/JUserChec.js"><script src="dwr/engine.js"><script src="/UploadFiles/2021-04-02/util.js"><script type="text/javascript">
function changeQx(p)
{
var val = p.value;
//alert(val);
JUserChec.jiLian(val, haschange);
}
function haschange(changeVal)
{
//alert(changeVal);
var jd = document.getElementById("jd");
var op = new Option(changeVal, changeVal);
jd.options.length=0;
jd.options.add(op);
}
</script>
<body>
<br><br>
<select onchange="changeQx(this)">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
</select>
<select id="jd">
</select>
</body>
dwr.xml
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE dwr
PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"
"http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<create creator="new" javascript="JUserChec">
<param name="class" value="com.struts.UserManager"/>
<include method="ccc"/>
<include method="jiLian"/>
</create>
</allow>
</dwr>
UserManager.java
package com.struts;
public class UserManager {
public boolean ccc(String uname){
if("abc".equals(uname)){
return true;
}
return false;
}
public String jiLian(String qx){
if("a".equals(qx)){
return "a1#a2#a3";
}
if("b".equals(qx)){
return "b1#b2#b3";
}
return "c1#c2";
}
}
标签:
jsp,dwr,级联
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“jsp dwr级联效果代码”评论...