[英]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.