First talk about annotation syntax, save dwr.xml. (Since Java 5, now the more I look at a heap of configuration files more annoying, more and more like the annotation method directly simple)
First download the latest stable version of the Dwr.jar file into your project. (Do you need anything else?) No need, DWR is so simple.
Then add the following paragraph to the Web.xml
Org.relax.service.SectionManager, Org.relax.service
dojo and ExtJS (and Yui). Dojo is better suited for enterprise applications and product development because offline storage, DataGrid, 2D, 3D graphics, Chart, comet, and other components are important for enterprise applications (of course, these components will have to wait for a while to stabilize). For example, the BEA has used dojo in a product developed based on mashup technology. ExtJS: Beautiful and "easy to use", and powerful enough. It is preferred when there is a greater need for the
DWR in the global error message shows only an error pop-up dialog box, this display does not meet our specific output and capture the exception information we throw in the Java program, after research and testing, finally found a solution, examples are as follows:
Java class, Operations Adminuservo class public class Useroperater {public String Save (Adminuservo Adminuservo) throws exception{if ("". Equals (Adminuservo.getname ())) throw new Exception
Recently, there are projects to do this kind of server push function, in Baidu search for a long time many are using sockets or related framework to achieve, and my project is Js+java implementation of the system, originally wanted to use Websocket+mina to do it, tried half a day to do a good deal of trouble, decisively give up, continue to find, Later found DWR, browse the relevant data feel is good, simple configuration can achieve a powerful functi
Open the browser, enter "localhost", then delete, and then enter "www.baidu.com". I'll go! ---XINGYUNPI use DWR implementation without refreshing dynamic submission, the result, configured to remote server unexpectedly appeared such a mistake, pop-up error window, error message for
"CSRF security Error" , Zocha right check, finally know why ... General
Tomcat6 is not such a mistake, replace
TOMCAT7 will be like this, listen to a foreigner said, tom
DWR conversion mapMap type mapping in DWR's official document only one word.
...
But there are always problems with this configuration when dealing with mapWe have a function as follows
Public mapAt this point we are configuring this in the Dwr.xml file
Import Java.util.Map;
Import java.util.List;
Import Test. Reportdwrutil;
Reportdwrutil.getparametervalues (String, map]]>
Running programs always throws the following exceptions
Java.lang.ClassCast
ProgramHow to find your "Dragon chair" in the future"
This article is based on "I can also be a CTO programmer career plan ".Book
Duan JunyiTechnical Manager of the Microsoft (China) Development Platform Cooperation Department, teched of
After you execute a method with parameters,
DWR1.3+TOMCAT5 does not appear invalid reply from server exceptionDWR2+TOMCAT5 invalid reply from server exception appearsdwr1.3+resin3.0.8 will appear invalid reply from server exception (the problem has
One, spring's proper use
Configuration of 1,dwr.xml
Copy Code code as follows:
Customermanager is the ID of the spring registration
2, page call
Copy Code code as follows:
Second,
In the previous issue, we talked about datawriter, which is essentially a product corresponding to datareader. In this issue, let's talk about Ext. Direct. Whether it's datawriter or ext. Direct, We can first check the official examples and combine
(1) Configure dwrservlet in Web. XML as follows:
DWR-invoker
org. directwebremoting. servlet. dwrservlet
debug
true
DWR-invoker
/DWR/*
(2) In
DWRConfigure in. xml
reslut -->
(3) Page Object lead object
(4) Page
debug
true
Resolution:
Parameters in the servlet range can only be obtained in the servlet Init () method. The configuration in Web. XML is as follows: mainservlet com. Wes. Controller. mainservlet param1 avalible in servlet Init () 0
Compile JavaCodeWe may often use buffalo to call Ajax, and publish a Java code directly to be remotely called by Js.
Method. At the same time, we may ignore the security issue. If the Java code is not as simple as reading data, it is to delete and
Ext. direct aims to provide a seamless streamline between the client and the server to form a single interface, so that we can reduce some tedious coding, for example, data verification and returned data packets (read data and error conditions ).
Implementation function: Sendmsg.jsp sends a message to the background, the background pushes the message to the Showmsg.jsp page.1, Web. XML configuration, add the following content in Web. xml:dwr
This method is suitable for embedding WebBrowser in C # to interact with the C # background code on pages loaded in the browser.
I. C # Program
1. Add WebBrowser to the C # form and add the URL of the page to the browser.
2. Add using System.
Copy codeThe Code is as follows: This js file can be stored in the jsp file you need to implement search results, or saved as a js file separately.Copy codeThe Code is as follows:Onkeydown = "oldKeyValue = this. value. trim (); setSelectedKey
This method works for embedded WebBrowser (browsers) in C # to interact with C # 's background code by loading pages in a browser.One, C # program1. Add WebBrowser (browser) to the C # form to add the URL of the page to the browser.2. Form code Add
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.