我试图将值传递给我的javascript函数,但该函数调用依赖于布尔变量.在我最近升级到百日咳安全5之前,我一直工作得很好.
这是代码段.
<body th:onload="${timerEnabled} ? 'javascript:runTimer(\'' + ${timeRemaining} + '\');'">
Run Code Online (Sandbox Code Playgroud)
对于要完成的函数调用,timerEnabled必须为true,但是thymeleaf现在会抛出异常
org.thymeleaf.exceptions.TemplateProcessingException: Only variable expressions returning numbers or booleans are allowed in this context, any other datatypes are not trusted in the context of this expression, including Strings or any other object that could be rendered as a text literal. A typical case is HTML attributes for event handlers (e.g. "onload"), in which textual data from variables should better be output to "data-*" attributes and then read from the event …
Run Code Online (Sandbox Code Playgroud) 我检查过其他帖子,但版本似乎发挥了作用,我的 Spring Boot 版本是
'2.1.8.RELEASE'
Run Code Online (Sandbox Code Playgroud)
Spring boot 不以依赖项启动我尝试了多种选项来启动应用程序,但没有成功。我只想使用 S3 和 RDS,也许还有 EC2。
任何帮助深表感谢。谢谢。
implementation 'org.springframework.cloud:spring-cloud-starter-aws'
Run Code Online (Sandbox Code Playgroud)
和配置
cloud.aws.region.static=us-east-1
cloud.aws.credentials.accessKey=key
cloud.aws.credentials.secretKey=secret
cloud.aws.region.auto=true
# Disable auto cloud formation
cloud.aws.stack.auto=false
Run Code Online (Sandbox Code Playgroud)
继续报错:
2019-09-20 01:25:24.740 WARN 18552 --- [ restartedMain] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.aws.core.env.ResourceIdResolver.BEAN_NAME': Invocation of init method failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stackResourceRegistryFactoryBean' defined in class path resource [org/springframework/cloud/aws/autoconfigure/context/ContextStackAutoConfiguration.class]: Unsatisfied dependency expressed through method 'stackResourceRegistryFactoryBean' parameter …
Run Code Online (Sandbox Code Playgroud)