The following error occurs when SpringMVC integrates DWR over the past few days:
Multiple annotations found at this line:-Cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dwr: annotation-config '.-Schema_reference.4: Failed to read schema document 'HTTP: // www.directwebremoting.org/schema/spring-dwr/spring-
what is DWR.
DWR is a Java project with open source. DWR allows JavaScript to invoke Java programs that run on a Web server. Simple or professional is easy AJAX for JAVA. Official website: http://getahead.org/dwr, the following step-by-step introduction to how to complete a simple demo:testdwr.
First, download the Dwr
Generally, the method to obtain the value of the DWR method on the page is
Function Test (){
Dwrtest. Hello (function (data) {alert (data )})
}
It is difficult to return this value for your JavaScript test method. The DWR method returns the value after execution by calling the specified function. We often do this.
Function Test (){
VaR result;
Dwrtest. Hello (function (data) {result = data
Today, after unremitting efforts, I finally gotSSH2 + DWR + jqueryThe example is not easy. After all, I have never touched this form of things before. I want to take a good note.
FirstSSH2That isSpring + struts2 + hibernate. This is currently popularJava WebApplication Development Mode. The key to this simplicity is to ensure that the class libraries of your applications do not conflict with each other. Otherwise, you will be exhausted simply by loo
Adopt Dwr+ajax and Struts Development File Upload progress bar
writing a listener and related classes
Do not write yourself, the source code can be from
Http://www.telio.be/blog/2006/01/06/ajax-upload-progress-monitor-for-commons-fileupload-example inside Download,
Download Address
Http://www.telio.be/blog/wp-content/uploads/2006/01/ajax-upload-1.0.war
After downloading, you need to unpack the package a
A JavaScript error occurred while running HelloWorld
"Error: Object does not support this property or method"
In IE browser http://localhost:8000/Struts_Dwr/dwr/test/service can appear SayHelloWorld ();
can also run
The results of the operation are:
SayHelloWorld (); "Hello worldwanxuesi!"
But running with JavaScript in a JSP will report the above error, why.
The JSP code is as follows:
Solution:
To downlo
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 ar
DWR (Direct Web remoting) is an open-source Ajax framework for remote servers to improve web page interaction with Java.
(1) Import DWR. jar, commons-logging-1.2.jar
(2) Add in the web. xml file
(3) create the DWR. xml file in the WEB-INF folder
Dwrtest class
public class DWRTest {public int getData(int index){Random rand = new Random();return rand.nextInt
DWR Full Name Direct WEB Remoting principle transforms Java code into JS object for cross-domain accessXml Dwr.xml packageorg.konghao.dwr.model;importjava.io.file;importjava.io.ioexception;import java.io.inputstream;importjava.util.arraylist;importjava.util.list;import javax.servlet.http.httpservletrequest;importorg.apache.commons.io.fileutils;import org.apache.commons.io.filenameutils;importorg.directw
At the weekend, study dwr at home and do an example. Implements a message from the client to the server, after the message is returned, displayed on the client. The code is as follows:
JSP page:
String path = Request.getcontextpath ();String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";%>
Haha, see the address is not AH. The basepath of this p
As a widely used WEB application development technology, AJAX firmly established its position, followed by some of the common Ajax usage patterns. For example, Ajax is often used to respond to user input and then modify part of the page with new data obtained from the server. However, sometimes the Web application's user interface needs to be updated to respond to asynchronous events that occur on the server side without requiring user action-for example, displaying new messages to an Ajax chat
I probably looked at Dwr's push mechanism, and my understanding is:Server state saved in ScriptsessionThe engine on the client page sends the request to the Web server periodically, see scriptsession, if found not to be empty, then send the JS call saved in Scriptsession to the client page, otherwise the thread waits for a certain time, but scriptsession is obtained by DWR the internal context object, which means that it cannot be changed beyond the
Ajax
The AJAX Framework Direct Web Remoting (DWR) project team recently announced the DWR 1.1 release.
DWR (Direct Web Remoting) is a WEB remote call framework that makes it easy to develop Ajax.
New features included in this new release include improved forms and forms of the DHTML Library (DWRUTIL), integrated struts, JSF, and beehive,
1About ScriptsessionScriptsession will not be created with httpsession at the same time, when we visit a page, if it is the first time, we will create a newHttpSession, and then, when you revisit it, you will keep the current session, even if it is refreshed, to keep the current HttpSession.However, unlike Scriptsession, the first access will create a scriptsession, but if you refresh, a new scriptsession will be created.2 How to get scriptsession in Dwr
Recently, a framework called dwr was used in the project. Since I just saw js for a few days, I don't understand many things, first, a web application using the dwr framework is configured according to the information on the Internet.
Eclipse: Juno Service Release 2
Tomcat: version-6.x
Jdk: 6.x
Use eclipse to create a dynamic web project.
Modify web. xml
Create three classes
Package com. charvis. model;
Document directory
1. receive page of push message
2. Java class responsible for pushing messages
3. Remaining work
The dwr2.0.x push technology is used to push and send messages. It is suitable for chatroom, stock information display, and other scenarios. It is better than the current JS regular polling Server policy, this greatly saves resources on the server side (no need to respond to the scheduled query of the client when no data changes ).
At, the system was able to operate normally
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.