问题标签 [spelevaluationexception]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
892 浏览

spring - 从 xpath 有效负载设置 bean 属性

我试着做这样的:

但它不起作用。

另外,我正在尝试这个:

我得到:

原因:org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): 在“org.springframework.beans.factory.config.BeanExpressionContext”类型的对象上找不到属性或字段“headers” - 可能不是公共的? 在 org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:215) 在 org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:85)

0 投票
2 回答
610 浏览

spring-mvc - Thymeleaf SpringMVC 页面页脚找不到控制器

我有一个使用 SpringMVC 和 Thymeleaf 的 spring boot 项目。我在包含在每个页面上的 layout.html 中定义了一个页脚。无论如何要在该页脚上包含一个显示每个页面的“状态”的调用。这样当您浏览网站时,页脚总是会显示所需的信息?

我有一个放置状态对象的 REST 控制器:

我的 footer.html 中有一个定义:

然后每个页面都包含如下页脚:

我在我的控制器中放置了一个断点并且它没有被调用,并且我总是在页面加载时得到这个异常:

org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): 在 null 上找不到属性或字段“状态”

我想知道控制器是否永远不会被调用,因为我必须使用像 jQuery 这样的东西来进行 Ajax 调用,或者因为我的 layout.html 中有这个并且包含不调用(这似乎不太可能)?

0 投票
1 回答
71 浏览

spring-integration - 从 SI v 2.2 升级到 v 3.0.5 后网关接口中断

将 SI 从 v 2.2 升级到 v 3.0.5 后,我收到以下网关的错误。v 3.x 中网关接口的行为是否已更改为不接受消息类型?任何提示将不胜感激为什么会发生这种情况。

org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 8): Method call: Method sendStat(my.domain.ReplyStatEvent) can not be found on com.sun.proxy.$Proxy22 type]

ReplyStatEvent 扩展了 LiveStatEvent 并且使用如下服务激活器定义调用网关:

将界面更改为以下内容后,它可以正常工作。

0 投票
2 回答
24000 浏览

spring - 无法在 Spring Security 中验证 url 模式的角色

我正在使用 spring security 3.1.7.RELEASE 和 spring 3.2.13.RELEASE。

我的 spring-security.xml 中有如下条目:

当我尝试点击 url /siteadmin/cleancache.htm 我得到以下异常:

java.lang.IllegalArgumentException:无法评估表达式'ROLE_ADMIN' .java:34) org.springframework.security.web.access.expression.WebExpressionVoter.vote(WebExpressionVoter.java:18) org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:62)

根本原因:

org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): 在“org.springframework.security.web.access.expression.WebSecurityExpressionRoot”类型的对象上找不到属性或字段“ROLE_ADMIN” - 也许不公开?org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:214) org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:85) org.springframework.expression.spel.ast。 PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:78) org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102) org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:98) org.springframework.security.access。

任何关于相同的指针都受到高度赞赏。

0 投票
1 回答
5045 浏览

java - Jhipster - JpaRepository "principal.username" @Query - org.springframework.expression.spel.SpelEvaluationException

在使用特定方法测试我的休息控制器时出现错误。我正在使用@Query注释来进行数据库查询。它使用“principal.username”来做到这一点。我没有关于如何在我的应用程序中获取和使用 principal.username 的全部图片。我目前正在查看有关它的 spring-security 文档。但是我的问题出在测试部分,当我执行下面的测试时,由于@Query.

存储库:

休息控制器方法:

一个测试:

而这个错误:

编辑

如何能够在测试中使用这个“?#{principal.username}”?经过调查,我在这里发现:Spring Security 4.0: WebSocket, Spring Data and Test Support

Spring Data Integration 现在可以使用 SpEL 在 Spring Data 查询中访问当前用户。要使用 Java 配置启用此功能,您可以定义一个 @Bean。

然后,您可以在查询中参考 Spring Security 的主体。例如:

是上下文问题吗?

0 投票
1 回答
2401 浏览

java - Spring Security 产生 Null CSRF 令牌 - 在 null 上找不到属性或字段“parameterName”

几天来,我一直在尝试实施 Spring Security,并且一直在努力解决csrf tokens.

我已经调试CsrfRequestDataValueProcessor并发现以下行返回null。

使用 Thymeleaf 我有以下形式:

它不渲染并引发以下异常:

请求处理失败;嵌套异常是 org.thymeleaf.exceptions.TemplateProcessingException:异常评估 SpringEL 表达式:“_csrf.parameterName”(loginsample:19)] 根本原因 org.springframework.expression.spel.SpelEvaluationException:EL1007E:(pos 0):属性或字段在 null 上找不到“参数名称”

为什么会这样?

0 投票
1 回答
237 浏览

spring - 带有 CGLIB 的 Spring 代理类 - 如何发现函数参数的名称

我想@EventListener在代理对象上使用带有条件属性的注释。EL 表达式使用函数的参数。但是在运行期间,org.springframework.core.LocalVariableTableParameterNameDiscoverer无法从 CGLIB 生成的代理读取调试信息,这就是无法访问参数的原因。结果我得到

p>

如何公开参数名称或如何让 spring 分析原始类而不是代理?

0 投票
4 回答
28427 浏览

spring - 无参数方法上的@Cacheble 注释

我想对@Cacheable没有参数的方法进行注释。在这种情况下,我使用 @Cacheable 如下

但是,当我调用此方法时,它不会被执行,并且会出现如下异常

org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): 在“org.springframework.cache.interceptor.CacheExpressionRootObject”类型的对象上找不到属性或字段“mykey” - 也许不公开?

请建议。

0 投票
1 回答
3164 浏览

spring-mvc - Spring / Thymeleaf:在 null 上找不到属性或字段“标题”。为什么?

应用程序抛出 org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Property or field 'title' cannot be found on null

我不明白为什么......这是主人调用的html片段。

然而,当应用程序启动时,字段标题不为空!这里我们有对象 allSurveys 的映射,它从 repo 中获取所有调查并返回一个列表。

作为证据,我们可以看到调查的标题打印在控制台上: 控制台输出

它们存在于数据库 调查数据库中

那么为什么它说那是空的呢?我在互联网上看到了不同的答案,但似乎没有一个可以解决我的问题。

预先感谢您的帮助。

编辑:根据建议,我尝试打印对象 ${surv}。我将内部 div 的“surv-ct”属性从 ID 更改为 class,因为它们应该很多。

当我在 Mozilla 上分析代码时,结果是这样的。

首先,只打印一个结果。其次,它没有得到任何生存对象。这就是我猜“标题”字段为空的原因。那么为什么对象为空呢?有什么建议吗?

0 投票
1 回答
100 浏览

spring-security - 错误:IllegalArgumentException - Spring 安全性。请给我一个解决方案

我正在做春季安全。当我浏览器http://localhost:8080/rest/user/json/quypham然后发生以下错误:

[警告] /rest/user/json/quypham java.lang.IllegalArgumentException:无法在 org.springframework.security.access.expression.ExpressionUtils.evalua teAsBoolean(ExpressionUtils.java:15) 在 org.springframework 评估表达式“ROLE_ADMIN” .security.web.access.expression.WebExpressionVoter .vote(WebExpressionVoter.java:36) at org.springframework.security.web.access.expression.WebExpressionVoter .vote(WebExpressionVoter.java:18) at org.springframework.security.access .vote.AffirmativeBased.decide(AffirmativeBased.java:62) at org.springframework.security.access.intercept.AbstractSecurityInterce ptor.beforeInvocation(AbstractSecurityInterceptor.java:232) at org.springframework.security.web.access.intercept.FilterSecurityInter

原因:org.springframework.expression.spel.SpelEvaluationException: EL1008E: (pos 0): 在“org.s pringframework.security.web.access.expression.WebSecurityExpressionRoot”类型的对象上找不到属性或字段“ROLE_ADMIN” -也许不公开?在 org.springframework.expression.spel.ast.PropertyOrFieldReference.read Property(PropertyOrFieldReference.java:215) 在 org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:85) 在 org.springframework.expression .spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:78) at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(Sp elNodeImpl.java:114) at org.springframework.expression.spel.standard.SpelExpression .

我认为文件中有错误的userservice-servlet.xml东西,请告诉我。

这里文件 userservice-servlet.xml