我尝试了很多条件,但是没有用!
<b:if cond='data:blog.url == data:blog.homepageUrl + "p/contact-us.html"'>
<b:if cond='data:blog.url == data:blog.homepageUrl + "p/contact-us.html"'>
<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/contact-us.html"'>
<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/contact-us.html"'>
<b:if cond='data:blog.pageType == data:blog.homepageUrl + "p/contact-us.html"'>
<b:if cond='data:blog.pageType == data:blog.homepageUrl + "p/contact-us.html"'>
答案 0 :(得分:1)
使用@EnableBinding({Source.class,Sink.class})
@RestController
public class SourceExample {
@Autowired
private Source source;
@GetMapping("/newMessage")
public UserMessage sendMessage(@RequestParam("messageBody") String messageBody,
@RequestParam("username") String username) {
UserMessage userMessage = new UserMessage(messageBody, username, LocalDateTime.now());
this.source.output().send(new GenericMessage<>(userMessage));
return userMessage;
}
@StreamListener(target = Sink.INPUT)
public void handle(UserMessage userMessage) throws IOException {
System.out.println(userMessage);
}
}
测试是否正在访问特定页面
data:blog.pageId
编辑页面时,可以在地址栏中找到 Page_ID
答案 1 :(得分:0)
我只是使用有条件的页面名称!