求教有关DWR实现调用有JavaBean参数的java方法
dwr.xml如下:
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"
"http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<create creator="new" javascript="Blbean">
<param name="class" value="bean.Blbean"/>
<include method="isUse"/>
<include method="getUser"/>
</create>
<convert converter="bean" match="bean.User">
<param name="include" value="username,password" />
</convert>
</allow>
</dwr>
JSP如下:
<script src='dwr/interface/Blbean.js'></script>
<script src='dwr/engine.js'></script>
<script src='dwr/util.js'></script>
......
function callExfun(){
var user;
user={username:"lingx",password:"123456"}
Blbean.printUser(user);
}
bean.Blbean 的printUser方法如下:
......
public void printUser(User user){
System.out.println(user.getUsername());
System.out.println(user.getUsername());
}
bean.User如下:
......
private String username;
private String password;
public User(String s1,String s2){
this.username = s1;
this.password = s2;
}
public String get......
public void set.....
......
JSP加载时控制台信息如下:(没有错误或者警告)
2008-5-29 8:35:59 org.directwebremoting.util.CommonsLoggingOutput info
信息: DWR Version 2.0.3 starting.
2008-5-29 8:35:59 org.directwebremoting.util.CommonsLoggingOutput info
信息: - Servlet Engine: Apache Tomcat/5.5.20
2008-5-29 8:35:59 org.directwebremoting.util.CommonsLoggingOutput info
信息: - Java Version: 1.5.0_04
2008-5-29 8:35:59 org.directwebremoting.util.CommonsLoggingOutput info
信息: - Java Vendor: Sun Microsystems Inc.
2008-5-29 8:36:00 org.directwebremoting.util.CommonsLoggingOutput info
信息: Probably not an issue: org.jdom.Document is not available so the jdom converter will not load. This is only an problem if you wanted to use it.
2008-5-29 8:36:00 org.directwebremoting.util.CommonsLoggingOutput info
信息: Probably not an issue: org.jdom.Element is not available so the jdom converter will not load. This is only an problem if you wanted to use it.
就是没有办法实现调用printUser方法,本人新学dwr望高人指正~