Integrated implementation code of dwr spring_javascript skills
May 16, 2016 pm 06:55 PM1. Correct use of spring
1. Configuration of dwr.xml
<dwr>
<allow>
<!-- dwr spring -->
<create creator="spring" javascript="JCustomerManager">
<param name="beanName" value="customerManager"/>
</create>
</allow>
</dwr>
customerManager It is the Id
2 registered by spring, and the page calls
<script type="text/javascript">
function manager(){
JCustomerManager.deleteCustomer(1,function(){
alert("cg");} //Test
)
}
</script>
Second, explain
If the regular methods used in the business logic class customerManagerImpl.java will not be called by the static page, such as
public String test(){
return "hello" ;
}
The following code cannot be executed:
JCustomerManager.test(function(data){
alert(data);}
)
JCustomerManager.test(function(data){
alert(data);}
)
Need to use new registration method
<dwr>
<allow>
<!-- dwr spring -->
<create creator="new" javascript="JCustomerManager">
<param name="class" value="...XXX.customerManager"/>
</create>
</allow>
</dwr>
<dwr>
<allow>
<!-- dwr spring -->
<create creator="new" javascript="JCustomerManager">
<param name="class" value="...XXX.customerManager"/>
</create>
</allow>
</dwr>
Third, you need to use new and spring correctly, and pay attention to the difference between the two.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What are the implementation methods of spring programmatic transactions?

A new programming paradigm, when Spring Boot meets OpenAI

Use Spring Boot and Spring AI to build generative artificial intelligence applications

How to implement scheduled tasks in Java Spring

The differences and connections between Spring Boot and Spring Cloud

How to set transaction isolation level in Spring

Application of JUnit unit testing framework in Spring projects

The 7 most commonly used annotations in Spring, the most powerful organization in history!
