简体   繁体   English

@RequestMapping 注解是 DWR 的替代品吗?

[英]Is @RequestMapping annotation a replacement of DWR?

I'm new to the spring-boot framework and a little bit confused.我是 spring-boot 框架的新手,有点困惑。
Previously we use DWR to convert JAVA method in server's war package to javascript function.之前我们使用DWR将服务器war包中的JAVA方法转换为javascript函数。 In Spring boot is the annotation @RequestMapping do the same?在 Spring boot 中,注解 @RequestMapping 是否也一样? Thx.谢谢。

No, the @RequestMapping annotation is not related to Direct Web Remoting .不,@ RequestMapping 注释Direct Web Remoting无关。 The annotation is used in the controller layer of Spring web applications to map requests onto methods.该注解用于 Spring Web 应用程序的控制器层以将请求映射到方法上。

A typical example for a RequestMapping looks as follows: RequestMapping典型示例如下所示:

@RequestMapping(method = RequestMethod.GET, path = "/users")
public ResponseEntity<List<Post>> getPosts() {
    [...]
}

This will map incoming GET requests to path /users to this method.这会将传入的GET请求映射到此方法的路径/users

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 给出错误的注释 RequestMapping() - Annotation RequestMapping() giving the error 在RequestMapping批注中添加验证 - Adding validation in RequestMapping annotation 春季启动@RequestMapping注释 - Spring boot @RequestMapping annotation @FeignClient 接口上不允许使用@RequestMapping 注释 - @RequestMapping annotation not allowed on @FeignClient interfaces @RequestMapping注解中path和value属性的区别 - Difference between path and value attributes in @RequestMapping annotation 与@RequestMapping 一起使用的自定义注释在 spring 引导中不起作用 - Custom annotation used with @RequestMapping is not working in spring boot 在运行时更改 Spring RequestMapping 注释值 - Changing Spring RequestMapping annotation value at runtime 如何在没有whitelabel错误的情况下使用@RequestMapping或@GetMapping注释? - how can I use @RequestMapping or @GetMapping annotation without whitelabel error? 为什么RequestMapping注释不适用于springboot应用程序中的类? - Why RequestMapping annotation does't work with class in springboot application? Spring 引导执行器自定义 RestControllerEndpoint 与 class 级别的 RequestMapping 注释 - Spring Boot Actuator Custom RestControllerEndpoint with RequestMapping Annotation on class level
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM