I am using dwr to send and send some information, but I get the following mistake. Tried to use the following line to view the file:
http: // localhost: 8080 />> Service (DwrSampleTest) Servlets-DWR / dwr / index.html
I get the following exception: Access to debug pages Rejected. Here's my Dwr.xml:
DWR & gt; & lt; allow & gt; & Lt; create creator = "new" javascript = "dwarmsm" & gt; param name = "class" value = "com.dwrsample.servlet.DwrSampleTest" /> Lt; / Allow & gt; & lt; / DWR & gt; web.xml:
& lt; servlet & gt; LT; servlet-name & gt; DWR-invoker & lt; / servlet-name & gt; & lt; servlet category & gt; org.directwebremoting.servlet.DwrServlet & lt; / servlet category & gt; & lt; init- Param & gt; & lt; super-name & Gt; crossDomainSessionSecurity & lt; / ultimate-name & gt; & lt; ultimate-value & gt; false & lt; / ultimate-value & gt; & lt; / init-param & gt; & lt; init-param & Gt; & lt; param-name & gt; debug & lt; / param-name & gt; & lt; super-value & gt; false & lt; / ultimate-value & gt; & lt; / init-param & Gt; & lt; / servlet & gt; & lt; servlet & gt; & lt; servlet-name & gt; DwrsampleServlet & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Com.dwrsample.servlet.DwrsampleServlet & lt; / Servlet category & gt; & Lt; / Servlet & gt; & Lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; DWR-invoker & lt; / Servlet-name & gt; & Lt; URL pattern & gt; / DWR / * & lt; / URL pattern & gt; & Lt; / Servlet-mapping & gt; and the file on which I call:
& lt;% @ page content type = "text / html" page encoding = "UTF - 8 "% & gt; & Lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Title & gt; DWR Sample & lt; / Title & gt; & Lt; Script src = 'dwr / dwr / engine.js' & gt; & Lt; / Script & gt; & Lt; Script src = 'dwr / dwr / util.js' & gt; & Lt; / Script & gt; & Lt; Script src = 'dwr / dwr / interface / DwrSampleTest.js' & gt; & Lt; / Script & gt; & Lt; Script & gt; Function getName () {DwrSampleTest.getName ({callback: setName, async: false}); } Function Set Name (strName) {document.getElementById ("enterdwr"). Value = ""; Document.getElementById ("enterdwr"). Value = strName; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; DWR sample test! & Lt; / H1> & Lt; Form method = "post" name = "dwrsample" id = "dwrsample"> & Lt; Table & gt; & Lt; Tr class = "lightrow" & gt; & Lt; Td width = "1%" & gt; * & Lt; / Td> & Lt; Td width = "39%" & gt; Enter DWR & lt; / Td> & Lt; Td width = "60%" & gt; Input name = "enterdwr" id = "password" type = "text" onblur = "getName ()" /> gt; & Lt; / Td> & Lt; / TR & gt; & Lt; Tr class = "lightrow" & gt; & Lt; Td width = "1%" & gt; * & Lt; / Td> & Lt; Td width = "39%" & gt; DWR result & lt; / Td> & Lt; Td width = "60%" & gt; & Lt; Input name = "resultdwr" id = "password" type = "text" /> gt; & Lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt; Please help me solve it.
Change the entry in the Dwr.xml file as follows
& lt ; Creator = "new" javascript = "DwrSampleTest" & gt; & Lt; Param name = "square" value = "com.dwrsample.servlet.DwrSampleTest" /> & Lt; / Create & gt; Javascript = "DwrSampleTest" must match the service name that you call on the jsp page. You have named the javaclass name by calling the JavaScript class name.
To enable more debug
& lt; Init-param & gt; & Lt; Ultimate Name & gt; Debug & lt; / Lastname & gt; & Lt; Ultimate Price & gt; True & lt; / Super-valued & gt; & Lt; / Init-param & gt; Change the absolute value correct.
Comments
Post a Comment