最近正在学习dwr,但遇到一个问题,望大家帮忙解决一下。
我在使用dwr的时候,一直不能发现我写的类,代码如下:
dwr.xml中是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<create creator="new" javascript="test">
<param name="class" value="hello.Test"/>
</create>
</allow>
</dwr>Test类中的代码是:
package hello;public class Test {
public Test() {
}
public String hello(){
return "OK";
}
}当我运行的时候,就发生异常
警告: Error setting class=hello.Test on org.directwebremoting.create.NewCreatorjava.lang.IllegalArgumentException: Class not found: hello.Test
.
.
2007-5-7 16:02:13 org.directwebremoting.util.CommonsLoggingOutput error严重: Creator: 'NewCreator[test]' for test.js is returning null for type queries.但当我使用java api 中的类时候,就没有出什么问题。如:java.util.Date.
或者我把写好的类打成一个jar包,在运行也没有问题。
请帮忙看看,这是为什么?
我在使用dwr的时候,一直不能发现我写的类,代码如下:
dwr.xml中是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<create creator="new" javascript="test">
<param name="class" value="hello.Test"/>
</create>
</allow>
</dwr>Test类中的代码是:
package hello;public class Test {
public Test() {
}
public String hello(){
return "OK";
}
}当我运行的时候,就发生异常
警告: Error setting class=hello.Test on org.directwebremoting.create.NewCreatorjava.lang.IllegalArgumentException: Class not found: hello.Test
.
.
2007-5-7 16:02:13 org.directwebremoting.util.CommonsLoggingOutput error严重: Creator: 'NewCreator[test]' for test.js is returning null for type queries.但当我使用java api 中的类时候,就没有出什么问题。如:java.util.Date.
或者我把写好的类打成一个jar包,在运行也没有问题。
请帮忙看看,这是为什么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货