问题标签 [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 投票
4 回答
2690 浏览

spring - spring security:为什么我们不能在@PreAuthorize 中访问 Hibernate 实体参数?

我有以下我正在应用@PreAuthorize 的接口方法:

其中User是一个Hibernate 实体对象。它给了我一个错误:

org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 13): 在 org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:204) 的 null 上找不到字段或属性“id”

参数不可能user为空,好像我删除了注释,并在实现此接口方法的方法中检查用户的值,那里存在一个有效的User对象。此外,就在调用此方法之前,我已确保正确构造了用户对象。

我真的无法弄清楚为什么userSPEL 解析器会将该字段视为 null

0 投票
2 回答
1642 浏览

spring - 如何使用 SpEL 在 @PostAuthorize 中访问模型内​​的对象

我创建这个方法只是为了解释这个场景。我想评估模型对象内的用户域对象。

我知道我可以评估返回对象和方法参数。但是当我尝试使用模型对象时出现以下错误,**不能在 PostAuthorize / PreAuthorize 中使用模型对象吗?**

错误

[请求处理失败;嵌套异常是 java.lang.IllegalArgumentException: 无法评估表达式 '#model.user.userName != 'ramesh''] 根本原因 org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 7): Field or property在“org.springframework.validation.support.BindingAwareModelMap”类型的对象上找不到“用户”

代码

0 投票
1 回答
1617 浏览

java - Spring Webflow org.springframework.expression.spel.SpelEvaluationException:EL1009E - 不能设置为空

我的代码:

类别-flow.xml

DefaultCategoryFacade.java

CategoryFormBackingObject.java

分类数据.java

这是我的例外:

“新”视图状态中的 flowScope.categories.editableCategory 也会发生同样的情况。这里有什么问题,我不知道!

0 投票
1 回答
1665 浏览

java - 使用 SpEL 复制 bean 的引用不起作用

我一直在尝试使用 Spring。我希望通过使用 SpEL 为另一个 bean 复制一个 bean 的值和引用属性。

考虑这个bean:

我希望将其值复制到另一个 bean 中,如下所示:

但是,我对第二个属性有一个例外,因为它无法复制肯尼的仪器。歌曲被正确复制,没有任何异常被抛出

我得到这个例外:

线程“main” org.springframework.beans.factory.BeanCreationException 中的异常:创建类路径资源 [Beans.xml] 中定义的名称为“carl”的 bean 时出错:设置时无法解析对 bean '#{kenny.instrument}' 的引用bean 属性“仪器”;嵌套异常是 org.springframework.beans.factory.BeanExpressionException:表达式解析失败;嵌套异常是 org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 6): Field or property 'instrument' cannot be found on object of type 'com.springinaction.springidol.Instrumentalist'

知道如何复制仪器并将其设置为 id 为“carl”的 bean 吗?

0 投票
2 回答
14126 浏览

spring-mvc - org.springframework.expression.spel.SpelEvaluationException: EL1027E:(pos 4): 不支持对类型“com.test.domain.Employee”的索引

我正在开发一个 Spring Roo 应用程序,在显示列表中的对象(在 list.jspx 中)时,我得到了引用对象的所有属性。例如:

和部门

现在,在 roo 中构建了一个 Web 项目,并添加了部门条目和员工条目之后,我在员工列表中得到了一个难看的表格。正在显示部门实体的所有属性,而我的意图是显示部门名称 (deptName)。

尝试在 list.jspx 中进行如下更改:

错误:

我该怎么办?

0 投票
1 回答
432 浏览

spring - 是否可以通过属性文件填充 spring util:list?

我想通过属性文件填充传输端点。我试过了,但没有用

在我的属性文件中,我有

我得到错误:

表达式解析失败;嵌套异常是 org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 14): Field or property 'service' can not be found on object of type 'java.util.Properties'

0 投票
1 回答
1501 浏览

java - Spring Cache + Spring 表达式语言 (SpEL) + Redis

org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Field or property 'orderId' cannot be found on null

orderId是我订单 Vo 中的财产之一

如何在我的应用程序方法签名中使用 Spring Spring Expression Language (SpEL) @Cacheable(value = "customerId", key = "#orderVO.orderId" )

0 投票
4 回答
24292 浏览

java - SpelEvaluationException: EL1007E:(pos 43): 在 null 上找不到字段或属性“组”

我为我的 Web 应用程序完全配置了 SPRING METHOD 安全性。(启用 PRE/POST 注释)。

但是最近我遇到了一个奇怪的问题。总结如下:

  1. POJOS总结

    /li>
  2. 方法上的 PreAuthorise 过滤器。

    /li>

在传递完全填充的GroupMembership对象(存在正确的用户和组组合)时,安全过滤器会引发以下异常:

在深入研究异常时:

发现原因是:

请提供指向相同地址的指针。

0 投票
0 回答
1412 浏览

spring - org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 8): 方法调用

我想在主页上显示数据库中的数据列表,但出现以下错误

org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 8): Method call: Method listAnnonce() can not be found on sujet.projet.collocation.domain.Annonce type at

用户.java

接口.java

接口Impl.java

主流.xml

Annonce.java

有人可以帮助我或建议我解决方案吗?

0 投票
4 回答
18494 浏览

java - What is the best way of defining key for @Cacheable annotation for Spring

If I am defining a ehcache for a method which doesn't have any parameter.

But in my use case I needs to access the my built cache through it's key.

So please provide me the better way of assigning key on it.

Follow is my code:

P.S. I am getting the following error when I am trying to access this method from somewhere else.

org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Field or property 'cacheKey' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'