JSP DWR Cascade effect Code _JSP programming

Source: Internet
Author: User
dwr.jsp
<script src= "Dwr/interface/juserchec.js" ></script>
<script src= "Dwr/engine.js" ></script>
<script src= "Dwr/util.js" ></script>
<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";
}
}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.