Home Web Front-end JS Tutorial Integrated implementation code of dwr spring_javascript skills

Integrated implementation code of dwr spring_javascript skills

May 16, 2016 pm 06:55 PM
spring

1. Correct use of spring
1. Configuration of dwr.xml

Copy code The code is as follows:

<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
Copy code The code is as follows:

<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
Copy code The code is as follows:

public String test(){
return "hello" ;
}

The following code cannot be executed:
Copy code The code is as follows:

JCustomerManager.test(function(data){
alert(data);}
)
JCustomerManager.test(function(data){
alert(data);}
)

Need to use new registration method
Copy code The code is as follows:

<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.
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What are the implementation methods of spring programmatic transactions? What are the implementation methods of spring programmatic transactions? Jan 08, 2024 am 10:23 AM

What are the implementation methods of spring programmatic transactions?

A new programming paradigm, when Spring Boot meets OpenAI A new programming paradigm, when Spring Boot meets OpenAI Feb 01, 2024 pm 09:18 PM

A new programming paradigm, when Spring Boot meets OpenAI

Use Spring Boot and Spring AI to build generative artificial intelligence applications Use Spring Boot and Spring AI to build generative artificial intelligence applications Apr 28, 2024 am 11:46 AM

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

How to implement scheduled tasks in Java Spring How to implement scheduled tasks in Java Spring May 24, 2023 pm 01:28 PM

How to implement scheduled tasks in Java Spring

The differences and connections between Spring Boot and Spring Cloud The differences and connections between Spring Boot and Spring Cloud Jun 22, 2023 pm 06:25 PM

The differences and connections between Spring Boot and Spring Cloud

How to set transaction isolation level in Spring How to set transaction isolation level in Spring Jan 26, 2024 pm 05:38 PM

How to set transaction isolation level in Spring

Application of JUnit unit testing framework in Spring projects Application of JUnit unit testing framework in Spring projects Apr 18, 2024 pm 04:54 PM

Application of JUnit unit testing framework in Spring projects

The 7 most commonly used annotations in Spring, the most powerful organization in history! The 7 most commonly used annotations in Spring, the most powerful organization in history! Jul 26, 2023 pm 04:38 PM

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

See all articles