I am using dwr to send and get some information but i get the following errore .
service(DwrSampleTest) is not defined
when i tried to use the following line to see the file :
http://localhost:8080/Servlets-DWR/dwr/index.html
i get the following exception : Access to debug pages is denied.
here is my 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="Dwrsample">
<param name="class" value="com.dwrsample.servlet.DwrSampleTest"/>
</create>
</allow>
</dwr>
web.xml :
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>DwrsampleServlet</servlet-name>
<servlet-class>com.dwrsample.servlet.DwrsampleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
and the file where i call the method :
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DWR Sample</title>
<script src='dwr/dwr/engine.js'></script>
<script src='dwr/dwr/util.js'></script>
<script src='dwr/dwr/interface/DwrSampleTest.js'></script>
<script>
function getName() {
DwrSampleTest.getName({callback:setName,async:false});
}
function setName(strName) {
document.getElementById("enterdwr").value = "";
document.getElementById("enterdwr").value = strName;
}
</script>
</head>
<body>
<h1>DWR Sample Test!</h1>
<form method="post" name="dwrsample" id="dwrsample">
<table>
<tr class="lightrow">
<td width="1%">*</td>
<td width="39%">Eenter DWR</td>
<td width="60%"><input name="enterdwr" id="password" type="text" onblur="getName()"/></td>
</tr>
<tr class="lightrow">
<td width="1%">*</td>
<td width="39%">DWR Result</td>
<td width="60%"><input name="resultdwr" id="password" type="text" /></td>
</tr>
</table>
</form>
</body>
</html>
please help me to solve this.
Change the entry in dwr.xml file as follows
you have called the javaclass name than calling the javascript class name.
and to get debug enabled
change the param value true.