小编kau*_*hik的帖子

如何在 jsonpath 中转义特殊字符冒号(':')

杰森:

{
    "im:rating": {
        "label": "1"
    }
}
Run Code Online (Sandbox Code Playgroud)

在尝试在 groovy 中使用 Jsonpath 时如果我使用这个'$.im: rating'

它显示以下错误

Caused by: com.nebhale.jsonpath.InvalidJsonPathExpressionException: Illegal
Run Code Online (Sandbox Code Playgroud)

字符 'PathCharacter [类型 = [],值 =:,位置 = 4]' $.im:评级 ----^ 非法字符 'PathCharacter [类型 = [SIMPLE_NAME_CHARACTER,LETTER,COMPLEX_NAME_CHARACTER],值 = r,位置 = 5 ]' $.im: rating -----^ 非法字符 'PathCharacter [types=[SIMPLE_NAME_CHARACTER, LETTER, COMPLEX_NAME_CHARACTER], value=a,position=6]' $.im: rating ------^ 非法字符 'PathCharacter [types=[SIMPLE_NAME_CHARACTER, LETTER, COMPLEX_NAME_CHARACTER], value=t,position=7]' $.im: rating -------^ 非法字符 'PathCharacter [types=[SIMPLE_NAME_CHARACTER, LETTER, COMPLEX_NAME_CHARACTER] ,值=i,位置=8]'$.im:评级--------^非法字符'PathCharacter [类型=[SIMPLE_NAME_CHARACTER,LETTER,COMPLEX_NAME_CHARACTER],值=n,位置=9]'$。 im:评级 ---------^ 非法字符 'PathCharacter [类型=[SIMPLE_NAME_CHARACTER,LETTER,COMPLEX_NAME_CHARACTER],值=g,位置=10]' $.im:评级 -------- --^

  at com.nebhale.jsonpath.JsonPath.compile(JsonPath.java:85)
  at com.nebhale.jsonpath.JsonPath.read(JsonPath.java:182)
Run Code Online (Sandbox Code Playgroud)

groovy parsing json jsonpath jsonparser

5
推荐指数
2
解决办法
7449
查看次数

react js中的条件内联样式

如果this.state.task.status == 'Completed'我想隐藏按钮(比如添加 display: none 属性)

代码:

<Button size="small"           
style={{display:this.state.task.status == "Completed" ? "none":""}}              
style={textColor} >Mark as Completed</Button>
Run Code Online (Sandbox Code Playgroud)

textColor是另一种工作正常的样式。

css reactjs material-ui

1
推荐指数
1
解决办法
9021
查看次数

Spring Webclient:非法参数异常没有足够的变量来扩展'comment_count'

我正在使用spring webclient发出带有{comment_count}的url的Facebook图形api请求

但是,得到这个例外

java.lang.IllegalArgumentException: Not enough variable values available to expand reactive spring
Run Code Online (Sandbox Code Playgroud)

代码段:

import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;

import reactor.core.publisher.Mono;

@Component
public class Stackoverflow {

    WebClient client = WebClient.create();

    public Mono<Post> fetchPost(String url) {
        // Url contains "comments{comment_count}"
        return client.get().uri(url).retrieve()
                .bodyToMono(Post.class);
    }
}
Run Code Online (Sandbox Code Playgroud)

我知道resttemplate的解决方案,但是我需要使用spring webclient。

illegalargumentexception facebook-graph-api spring-boot spring-webflux spring-webclient

0
推荐指数
1
解决办法
92
查看次数