我试图将一个变量从我的角前端发送到我的sprinboot后端。但是变量的值达到null。我试过几种方法,但不起作用。
我做错了什么吗?
Springboot JAVA
@RequestMapping(value = "/api/product")
@RequestMapping(value = "v2/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity <Page<ComponentDTO>> search(Long id, Pageable pageable) throws Exception {
return new ResponseEntity<>(this.service.search(id, pageable), HttpStatus.OK);
}服务类型
PATH = '/server/api/product';
list(id: number): Observable<EntityBase<Component>> {
return this.httpClient.get<EntityBase<Component>>(`${this.PATH}/v2/${id}`);
}跟踪跟踪
ORA-00932:不一致的数据类型:预期的数字得到二进制。
发布于 2021-05-20 22:54:23
在您的代码中有许多不正确的东西:
没有分页的Bellow示例,如果您想要添加分页,请尝试将页码作为查询解析发送到URL中,并使用@RequestParam注释来实现这一点。
@RequestMapping(value = "/v2/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity <Page<ComponentDTO>> search(@PathVariable("id") Long id) throws Exception {提示:使用@GetMapping代替。
https://stackoverflow.com/questions/67628595
复制相似问题