DWR2.03错误问题(菜鸟级),高手请指点下!
今天第一次尝试dwr,做了一个简单的例子,遇到了这样一个问题:May 21, 2008 3:49:38 PM org.directwebremoting. info
INFO: Exec: service.sayHello()
具体代码如下:
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.
xmlns:xsi="http://www.
xsi:schemaLocation="http://java.
http://java.
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
</web-app>
dwr.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://
<dwr>
<allow>
<create javascript="service" creator="new">
<param name="class" value="helloWorld.Service"></param>
</create>
</allow>
</dwr>
java :
package helloWorld;
public class Service {
public String sayHello(String yourname){
return "Hello World:"+yourname;
}
}
jsp:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<% String contextPath = request.getContextPath(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>MyFirst_Dwr</title>
<script language="javascript" src="js/engine.js"></script>
<script language="javascript" src="js/util.js"></script>
<script language="javascript" src="<%=contextPath%>/dwr/interface/service.js"></script>
<script language="javascript">
function firstDwr(){
service.sayHello("cuizhouyang",callBackHello);
}
function callBackHello(data){
alert(data);
}
</script>
</head>
<body>
<label>
<input type="button" name="button" value="测试" onclick="firstDwr()"/>
</label>
</body>
</html>
希望高手指点下!谢谢!