I heard that DWR can read classes and methods from the background to the front-end call, find a dwr practice practiced hand Find the simplest demo problem.
Problem:
Knock on the example of DWR that is carved out of the same result as the womb.
When running the front-end page: uncaughtedreference:xxx is not defined!
How did you guys get through this, big God? These articles all kinds of defects do not say also everywhere reproduced harm to oneself Ah!
Find a solution:
Check over and over again tangled in interface what to write JS content, Baidu saw a man like the problem: http://www.iteye.com/problems/64163
MB all over the whole TM is the same as the same kind of SB example can not use all still not necessarily!
Who the TM told me Interface/xxx.js this JB thing jumped out! I'm damn it!
The point is that this TM is actually not added to the reference JS. And it doesn't have to be added manually!
My grass!
It's actually automatically generated.
Original file:
<script src= "Js/engine.js" ></script><script src= "js/util.js" ></script><script src= "js/ Interface/dwruseraccess.js "></script>
Change to:
<script src= "Dwr/engine.js" ></script><script src= "dwr/util.js" ></script><script src= " Dwr/interface/xxx.js "></script>
Reason:
DWR has already been defined in Web. xml:
< servlet-mapping > < Servlet-name >dwr-invoker</servlet-name> <Url-pattern >/dwr/*</url-pattern></ Servlet-mapping>
DWR would actually read the JS file through the Dwrservlet in the Dwr.jar. It's amazing!
In vain downloaded from the csdn engine.js and util.js incredibly useless, incredibly also extorted 1 gold. Csdn that group of lifelike not face! Still hanging on top cheat gold! Dou Shi Pian zi!
DWR does not find a class in the background